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
047b754f
Commit
047b754f
authored
Jun 26, 2025
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handler for qextension: url reqeiring works.
parent
525064a2
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
2342 deletions
+177
-2342
qwebchannel.js
assets/browser/js/qwebchannel.js
+48
-41
test.py
test.py
+129
-19
test.py.back
test.py.back
+0
-2282
No files found.
assets/browser/js/qwebchannel.js
View file @
047b754f
/****************************************************************************
// Copyright (C) 2016 The Qt Company Ltd.
**
// Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
** Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Milian Wolff <milian.wolff@kdab.com>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebChannel module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 3 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL3 included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 3 requirements
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 2.0 or (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
"use strict"
;
"use strict"
;
...
@@ -53,7 +17,7 @@ var QWebChannelMessageTypes = {
...
@@ -53,7 +17,7 @@ var QWebChannelMessageTypes = {
response
:
10
,
response
:
10
,
};
};
var
QWebChannel
=
function
(
transport
,
initCallback
)
var
QWebChannel
=
function
(
transport
,
initCallback
,
converters
)
{
{
if
(
typeof
transport
!==
"object"
||
typeof
transport
.
send
!==
"function"
)
{
if
(
typeof
transport
!==
"object"
||
typeof
transport
.
send
!==
"function"
)
{
console
.
error
(
"The QWebChannel expects a transport object with a send function and onmessage callback property."
+
console
.
error
(
"The QWebChannel expects a transport object with a send function and onmessage callback property."
+
...
@@ -64,6 +28,43 @@ var QWebChannel = function(transport, initCallback)
...
@@ -64,6 +28,43 @@ var QWebChannel = function(transport, initCallback)
var
channel
=
this
;
var
channel
=
this
;
this
.
transport
=
transport
;
this
.
transport
=
transport
;
var
converterRegistry
=
{
Date
:
function
(
response
)
{
if
(
typeof
response
===
"string"
&&
response
.
match
(
/^-
?\d
+-
\d{2}
-
\d{2}
T
\d{2}
:
\d{2}
:
\d{2}(?:\.\d
*
)?([
-+
\u
2212
](\d{2})
:
(\d{2})
|Z
)?
$/
))
{
var
date
=
new
Date
(
response
);
if
(
!
isNaN
(
date
))
return
date
;
}
return
undefined
;
// Return undefined if current converter is not applicable
}
};
this
.
usedConverters
=
[];
this
.
addConverter
=
function
(
converter
)
{
if
(
typeof
converter
===
"string"
)
{
if
(
converterRegistry
.
hasOwnProperty
(
converter
))
this
.
usedConverters
.
push
(
converterRegistry
[
converter
]);
else
console
.
error
(
"Converter '"
+
converter
+
"' not found"
);
}
else
if
(
typeof
converter
===
"function"
)
{
this
.
usedConverters
.
push
(
converter
);
}
else
{
console
.
error
(
"Invalid converter object type "
+
typeof
converter
);
}
}
if
(
Array
.
isArray
(
converters
))
{
for
(
const
converter
of
converters
)
this
.
addConverter
(
converter
);
}
else
if
(
converters
!==
undefined
)
{
this
.
addConverter
(
converters
);
}
this
.
send
=
function
(
data
)
this
.
send
=
function
(
data
)
{
{
if
(
typeof
(
data
)
!==
"string"
)
{
if
(
typeof
(
data
)
!==
"string"
)
{
...
@@ -190,6 +191,12 @@ function QObject(name, data, webChannel)
...
@@ -190,6 +191,12 @@ function QObject(name, data, webChannel)
this
.
unwrapQObject
=
function
(
response
)
this
.
unwrapQObject
=
function
(
response
)
{
{
for
(
const
converter
of
webChannel
.
usedConverters
)
{
var
result
=
converter
(
response
);
if
(
result
!==
undefined
)
return
result
;
}
if
(
response
instanceof
Array
)
{
if
(
response
instanceof
Array
)
{
// support list of objects
// support list of objects
return
response
.
map
(
qobj
=>
object
.
unwrapQObject
(
qobj
))
return
response
.
map
(
qobj
=>
object
.
unwrapQObject
(
qobj
))
...
@@ -445,4 +452,4 @@ if (typeof module === 'object') {
...
@@ -445,4 +452,4 @@ if (typeof module === 'object') {
module
.
exports
=
{
module
.
exports
=
{
QWebChannel
:
QWebChannel
QWebChannel
:
QWebChannel
};
};
}
}
\ No newline at end of file
test.py
View file @
047b754f
This diff is collapsed.
Click to expand it.
test.py.back
deleted
100755 → 0
View file @
525064a2
This diff is collapsed.
Click to expand it.
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