1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Scripts: Install webchannel bridge in main world also on extension scheme

This commit is contained in:
David Rosca 2018-02-07 10:33:13 +01:00
parent 1ff43ec6d8
commit f7e64e2353
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -25,7 +25,7 @@
QString Scripts::setupWebChannel(quint32 worldId)
{
QString source = QL1S("// ==UserScript==\n"
"// %1\n"
"%1\n"
"// ==/UserScript==\n\n"
"(function() {"
"%2"
@ -72,9 +72,9 @@ QString Scripts::setupWebChannel(quint32 worldId)
QString match;
if (worldId == WebPage::SafeJsWorld) {
match = QSL("@exclude falkon:*");
match = QSL("// @exclude falkon:*\n// @exclude extension:*");
} else {
match = QSL("@include falkon:*");
match = QSL("// @include falkon:*\n// @include extension:*");
}
return source.arg(match, QzTools::readAllFileContents(QSL(":/qtwebchannel/qwebchannel.js")));
}