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
93c756e0
Commit
93c756e0
authored
Jun 25, 2025
by
Stefy Lanza (nextime / spora )
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning...
parent
ad530998
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
runtime_bridge.cpython-313.pyc
assets/browser/js/__pycache__/runtime_bridge.cpython-313.pyc
+0
-0
test.py
test.py
+16
-9
No files found.
assets/browser/js/__pycache__/runtime_bridge.cpython-313.pyc
View file @
93c756e0
No preview for this file type
test.py
View file @
93c756e0
...
@@ -1543,6 +1543,7 @@ class ChromeUrlInterceptor(QWebEngineUrlRequestInterceptor):
...
@@ -1543,6 +1543,7 @@ class ChromeUrlInterceptor(QWebEngineUrlRequestInterceptor):
# The actual handling is done by ChromeWebEnginePage
# The actual handling is done by ChromeWebEnginePage
# XXX QUI
class
ExtensionSchemeHandler
(
QWebEngineUrlSchemeHandler
):
class
ExtensionSchemeHandler
(
QWebEngineUrlSchemeHandler
):
"""A custom URL scheme handler for loading extension files."""
"""A custom URL scheme handler for loading extension files."""
def
__init__
(
self
,
extensions_dir
,
parent
=
None
):
def
__init__
(
self
,
extensions_dir
,
parent
=
None
):
...
@@ -1565,7 +1566,8 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
...
@@ -1565,7 +1566,8 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
if
os
.
path
.
exists
(
assets_file_path
):
if
os
.
path
.
exists
(
assets_file_path
):
file_path
=
assets_file_path
file_path
=
assets_file_path
try
:
#try:
if
True
:
with
open
(
file_path
,
'rb'
)
as
f
:
with
open
(
file_path
,
'rb'
)
as
f
:
content
=
f
.
read
()
content
=
f
.
read
()
...
@@ -1582,7 +1584,8 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
...
@@ -1582,7 +1584,8 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
# Special handling for HTML files - inject WebChannel initialization code
# Special handling for HTML files - inject WebChannel initialization code
if
file_path
.
endswith
((
'.html'
,
'.htm'
))
and
mime_type
in
(
b
'text/html'
,
b
'application/xhtml+xml'
):
if
file_path
.
endswith
((
'.html'
,
'.htm'
))
and
mime_type
in
(
b
'text/html'
,
b
'application/xhtml+xml'
):
print
(
f
"Injecting WebChannel initialization into HTML file: {file_path}"
)
print
(
f
"Injecting WebChannel initialization into HTML file: {file_path}"
)
try
:
#try:
if
True
:
# Decode the HTML content
# Decode the HTML content
html_content
=
content
.
decode
(
'utf-8'
)
html_content
=
content
.
decode
(
'utf-8'
)
...
@@ -1716,15 +1719,19 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
...
@@ -1716,15 +1719,19 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
# Convert back to bytes
# Convert back to bytes
content
=
html_content
.
encode
(
'utf-8'
)
content
=
html_content
.
encode
(
'utf-8'
)
except
Exception
as
e
:
#
except Exception as e:
print
(
f
"Error injecting WebChannel initialization: {e}"
)
#
print(f"Error injecting WebChannel initialization: {e}")
# Continue with the original content if there's an error
#
# Continue with the original content if there's an error
# Special handling for service worker scripts
# Special handling for service worker scripts
if
resource_path
.
endswith
(
'background.js'
):
if
resource_path
.
endswith
(
'background.js'
):
print
(
f
"Loading background script: {file_path}"
)
print
(
f
"Loading background script: {file_path}"
)
# You might want to add special headers or processing for service workers
# You might want to add special headers or processing for service workers
print
(
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaa"
)
print
(
file_path
)
print
(
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAaa"
)
buf
=
QBuffer
(
parent
=
self
)
buf
=
QBuffer
(
parent
=
self
)
buf
.
setData
(
content
)
buf
.
setData
(
content
)
buf
.
open
(
QBuffer
.
OpenModeFlag
.
ReadOnly
)
buf
.
open
(
QBuffer
.
OpenModeFlag
.
ReadOnly
)
...
@@ -1735,9 +1742,9 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
...
@@ -1735,9 +1742,9 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
# Reply with the content
# Reply with the content
job
.
reply
(
mime_type
,
buf
)
job
.
reply
(
mime_type
,
buf
)
print
(
f
"Replied with content for: {file_path}"
)
print
(
f
"Replied with content for: {file_path}"
)
"""
except
FileNotFoundError
:
except FileNotFoundError
as e
:
print
(
f
"Extension resource not found: {file_path}"
)
print(f"Extension resource not found: {file_path}
{e}
")
job.fail(QWebEngineUrlRequestJob.Error.UrlNotFound)
job.fail(QWebEngineUrlRequestJob.Error.UrlNotFound)
if job in self.jobs:
if job in self.jobs:
del self.jobs[job]
del self.jobs[job]
...
@@ -1747,7 +1754,7 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
...
@@ -1747,7 +1754,7 @@ class ExtensionSchemeHandler(QWebEngineUrlSchemeHandler):
if job in self.jobs:
if job in self.jobs:
del self.jobs[job]
del self.jobs[job]
"""
class
ExtensionDialog
(
QDialog
):
class
ExtensionDialog
(
QDialog
):
"""
"""
Dialog for managing browser extensions.
Dialog for managing browser extensions.
...
...
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