Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
SHMCamStudio
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SexHackMe
SHMCamStudio
Commits
525064a2
Commit
525064a2
authored
Jun 26, 2025
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Debugging...
parent
93c756e0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
23 deletions
+28
-23
chrome_popup.html
assets/browser/extensions/lovense/pages/chrome_popup.html
+1
-0
runtime_bridge.cpython-313.pyc
assets/browser/js/__pycache__/runtime_bridge.cpython-313.pyc
+0
-0
test.py
test.py
+27
-23
No files found.
assets/browser/extensions/lovense/pages/chrome_popup.html
View file @
525064a2
...
@@ -122,6 +122,7 @@
...
@@ -122,6 +122,7 @@
</div>
</div>
</div>
</div>
<script
src=
"/js/chrome_popup.js"
></script>
<script
src=
"/js/chrome_popup.js"
></script>
<script
src=
"/js/antani/sarca.js"
></script>
</body>
</body>
</html>
</html>
assets/browser/js/__pycache__/runtime_bridge.cpython-313.pyc
View file @
525064a2
No preview for this file type
test.py
View file @
525064a2
...
@@ -1541,6 +1541,9 @@ class ChromeUrlInterceptor(QWebEngineUrlRequestInterceptor):
...
@@ -1541,6 +1541,9 @@ class ChromeUrlInterceptor(QWebEngineUrlRequestInterceptor):
print
(
f
"Intercepted chrome:// URL: {url.toString()}"
)
print
(
f
"Intercepted chrome:// URL: {url.toString()}"
)
# We don't block the request, just log it for debugging
# We don't block the request, just log it for debugging
# The actual handling is done by ChromeWebEnginePage
# The actual handling is done by ChromeWebEnginePage
if
url
.
scheme
()
==
'qextension'
:
print
(
"*****************************************************"
)
print
(
info
)
# XXX QUI
# XXX QUI
...
@@ -1553,9 +1556,12 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
...
@@ -1553,9 +1556,12 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
self
.
assets_extensions_dir
=
"assets/browser/extensions"
# Path to the source extensions
self
.
assets_extensions_dir
=
"assets/browser/extensions"
# Path to the source extensions
def
requestStarted
(
self
,
job
:
QWebEngineUrlRequestJob
):
def
requestStarted
(
self
,
job
:
QWebEngineUrlRequestJob
):
print
(
"GGGGGGGGGGGGGGGGGGGGGGGGGGGG >>>>> "
)
print
(
job
)
url
=
job
.
requestUrl
()
url
=
job
.
requestUrl
()
ext_id
=
url
.
host
()
ext_id
=
url
.
host
()
resource_path
=
url
.
path
()
.
lstrip
(
'/'
)
resource_path
=
url
.
path
()
.
lstrip
(
'/'
)
print
(
url
,
self
.
extensions_dir
)
# First try to load from the profile's extensions directory
# First try to load from the profile's extensions directory
file_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
extensions_dir
,
ext_id
,
resource_path
))
file_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
self
.
extensions_dir
,
ext_id
,
resource_path
))
...
@@ -2730,15 +2736,14 @@ class Browser(QMainWindow):
...
@@ -2730,15 +2736,14 @@ class Browser(QMainWindow):
print
(
"Lovense extension configuration complete"
)
print
(
"Lovense extension configuration complete"
)
# Update loaded extensions list
self
.
update_extensions_list
()
# Install URL scheme handlers
# Install URL scheme handlers
self
.
extension_scheme_handler
=
ExtensionSchemeHandler
(
self
.
extensions_dir
)
self
.
extension_scheme_handler
=
ExtensionSchemeHandler
(
self
.
extensions_dir
)
# Reinstall URL scheme handlers
# Reinstall URL scheme handlers
self
.
profile
.
installUrlSchemeHandler
(
b
"qextension"
,
self
.
extension_scheme_handler
)
self
.
profile
.
installUrlSchemeHandler
(
b
"qextension"
,
self
.
extension_scheme_handler
)
# Re-add the chrome.runtime API script to the profile's scripts
#self.runtime_api_script = create_runtime_api_script()
#self.profile.scripts().insert(self.runtime_api_script)
# Re-register the RuntimeBridge with the QWebChannel
# Re-register the RuntimeBridge with the QWebChannel
self
.
web_channel
=
QWebChannel
(
self
)
self
.
web_channel
=
QWebChannel
(
self
)
self
.
runtime_bridge
=
RuntimeBridge
(
self
,
self
.
extensions_dir
,
self
)
self
.
runtime_bridge
=
RuntimeBridge
(
self
,
self
.
extensions_dir
,
self
)
...
@@ -2747,23 +2752,11 @@ class Browser(QMainWindow):
...
@@ -2747,23 +2752,11 @@ class Browser(QMainWindow):
# Initialize the content script injector
# Initialize the content script injector
self
.
content_script_injector
=
ContentScriptInjector
(
self
.
extensions_dir
)
self
.
content_script_injector
=
ContentScriptInjector
(
self
.
extensions_dir
)
# Re-register chrome:// protocol with Qt
QWebEngineProfile
.
defaultProfile
()
.
setUrlRequestInterceptor
(
ChromeUrlInterceptor
(
self
)
)
# Register chrome:// protocol interceptor
# Register chrome:// protocol interceptor
QWebEngineProfile
.
defaultProfile
()
.
setUrlRequestInterceptor
(
QWebEngineProfile
.
defaultProfile
()
.
setUrlRequestInterceptor
(
ChromeUrlInterceptor
(
self
)
ChromeUrlInterceptor
(
self
)
)
)
# Create and set up the RuntimeBridge for chrome.runtime API emulation
#self.runtime_bridge = RuntimeBridge(self, self.extensions_dir, self)
# Create a QWebChannel to communicate with JavaScript
#self.web_channel = QWebChannel(self)
#self.web_channel.registerObject("runtimeBridge", self.runtime_bridge)
# Add the chrome.runtime API script to the profile's scripts
# Add the chrome.runtime API script to the profile's scripts
self
.
runtime_api_script
=
create_runtime_api_script
()
self
.
runtime_api_script
=
create_runtime_api_script
()
self
.
profile
.
scripts
()
.
insert
(
self
.
runtime_api_script
)
self
.
profile
.
scripts
()
.
insert
(
self
.
runtime_api_script
)
...
@@ -3566,13 +3559,7 @@ class Browser(QMainWindow):
...
@@ -3566,13 +3559,7 @@ class Browser(QMainWindow):
self
.
open_extension_popups
.
append
(
popup_dialog
)
self
.
open_extension_popups
.
append
(
popup_dialog
)
popup_dialog
.
finished
.
connect
(
lambda
:
self
.
open_extension_popups
.
remove
(
popup_dialog
))
popup_dialog
.
finished
.
connect
(
lambda
:
self
.
open_extension_popups
.
remove
(
popup_dialog
))
def
update_extensions_list
(
self
):
def
update_extension_buttons
(
self
):
"""Scans for extensions and adds a button for each one with a popup to the main toolbar."""
# Remove previous extension buttons
for
action
in
self
.
extension_actions
:
self
.
toolbar
.
removeAction
(
action
)
self
.
extension_actions
.
clear
()
if
not
self
.
extensions_dir
or
not
os
.
path
.
exists
(
self
.
extensions_dir
):
if
not
self
.
extensions_dir
or
not
os
.
path
.
exists
(
self
.
extensions_dir
):
return
return
...
@@ -3607,6 +3594,23 @@ class Browser(QMainWindow):
...
@@ -3607,6 +3594,23 @@ class Browser(QMainWindow):
'id'
:
ext_name
'id'
:
ext_name
}
}
def
update_extension_buttons
(
self
):
"""Scans for extensions and adds a button for each one with a popup to the main toolbar."""
# Remove previous extension buttons
for
action
in
self
.
extension_actions
:
self
.
toolbar
.
removeAction
(
action
)
self
.
extension_actions
.
clear
()
if
not
self
.
extensions_dir
or
not
os
.
path
.
exists
(
self
.
extensions_dir
):
return
self
.
update_extensions_list
()
for
ext_name
in
self
.
loaded_extensions
.
keys
():
manifest
=
self
.
loaded_extensions
[
ext_name
][
'manifest'
]
# Check for a popup action
# Check for a popup action
popup_path
=
None
popup_path
=
None
action
=
manifest
.
get
(
'action'
)
or
manifest
.
get
(
'browser_action'
)
or
manifest
.
get
(
'page_action'
)
action
=
manifest
.
get
(
'action'
)
or
manifest
.
get
(
'browser_action'
)
or
manifest
.
get
(
'page_action'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment