@browserless.io/browserless 2.12.0-beta-3 → 2.12.0-beta-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/browsers/chromium.cdp.d.ts +1 -1
- package/build/browsers/chromium.cdp.js +2 -2
- package/build/browsers/chromium.playwright.d.ts +1 -1
- package/build/browsers/chromium.playwright.js +2 -2
- package/build/browsers/firefox.playwright.d.ts +1 -1
- package/build/browsers/firefox.playwright.js +2 -2
- package/build/browsers/index.d.ts +3 -2
- package/build/browsers/index.js +36 -17
- package/build/browsers/webkit.playwright.d.ts +1 -1
- package/build/browsers/webkit.playwright.js +4 -4
- package/build/routes/chrome/http/pdf.post.body.json +8 -8
- package/build/routes/chrome/http/scrape.post.body.json +8 -8
- package/build/routes/chrome/http/screenshot.post.body.json +8 -8
- package/build/routes/chromium/http/content.post.body.json +8 -8
- package/build/routes/chromium/http/pdf.post.body.json +8 -8
- package/build/routes/chromium/http/scrape.post.body.json +8 -8
- package/build/types.d.ts +1 -1
- package/extensions/ublock/_locales/eu/messages.json +4 -4
- package/extensions/ublock/_locales/hi/messages.json +5 -5
- package/extensions/ublock/_locales/kn/messages.json +11 -11
- package/extensions/ublock/_locales/nb/messages.json +2 -2
- package/extensions/ublock/_locales/no/messages.json +2 -2
- package/extensions/ublock/_locales/ro/messages.json +1 -1
- package/extensions/ublock/_locales/sv/messages.json +1 -1
- package/extensions/ublock/_locales/zh_CN/messages.json +2 -2
- package/extensions/ublock/assets/assets.json +3 -8
- package/extensions/ublock/assets/resources/scriptlets.js +128 -31
- package/extensions/ublock/assets/thirdparties/easylist/easylist.txt +4870 -3560
- package/extensions/ublock/assets/thirdparties/easylist/easyprivacy.txt +662 -173
- package/extensions/ublock/assets/thirdparties/pgl.yoyo.org/as/serverlist +10 -42
- package/extensions/ublock/assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat +241 -80
- package/extensions/ublock/assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt +2093 -1224
- package/extensions/ublock/assets/ublock/badlists.txt +2 -0
- package/extensions/ublock/assets/ublock/badware.min.txt +408 -287
- package/extensions/ublock/assets/ublock/filters.min.txt +947 -645
- package/extensions/ublock/assets/ublock/privacy.min.txt +43 -8
- package/extensions/ublock/assets/ublock/quick-fixes.min.txt +55 -93
- package/extensions/ublock/assets/ublock/unbreak.min.txt +52 -19
- package/extensions/ublock/css/1p-filters.css +2 -0
- package/extensions/ublock/css/codemirror.css +2 -2
- package/extensions/ublock/css/dashboard.css +2 -5
- package/extensions/ublock/css/epicker-ui.css +3 -3
- package/extensions/ublock/css/fa-icons.css +3 -0
- package/extensions/ublock/css/logger-ui-inspector.css +1 -0
- package/extensions/ublock/css/logger-ui.css +44 -32
- package/extensions/ublock/img/fontawesome/fontawesome-defs.svg +1 -0
- package/extensions/ublock/js/3p-filters.js +4 -5
- package/extensions/ublock/js/biditrie.js +16 -11
- package/extensions/ublock/js/cachestorage.js +37 -37
- package/extensions/ublock/js/contentscript-extra.js +0 -2
- package/extensions/ublock/js/contentscript.js +1 -6
- package/extensions/ublock/js/epicker-ui.js +28 -36
- package/extensions/ublock/js/fa-icons.js +1 -0
- package/extensions/ublock/js/hntrie.js +19 -13
- package/extensions/ublock/js/logger-ui-inspector.js +6 -13
- package/extensions/ublock/js/logger-ui.js +264 -264
- package/extensions/ublock/js/s14e-serializer.js +267 -264
- package/extensions/ublock/js/scriptlet-filtering.js +12 -18
- package/extensions/ublock/js/scriptlets/dom-inspector.js +1 -5
- package/extensions/ublock/js/scriptlets/epicker.js +53 -59
- package/extensions/ublock/js/start.js +0 -8
- package/extensions/ublock/js/storage.js +2 -9
- package/extensions/ublock/js/vapi-background.js +19 -20
- package/extensions/ublock/js/vapi-common.js +2 -7
- package/extensions/ublock/js/vapi.js +0 -4
- package/extensions/ublock/js/webext.js +23 -15
- package/extensions/ublock/logger-ui.html +24 -15
- package/extensions/ublock/manifest.json +2 -3
- package/package.json +2 -2
- package/src/browsers/chromium.cdp.ts +2 -2
- package/src/browsers/chromium.playwright.ts +2 -2
- package/src/browsers/firefox.playwright.ts +2 -3
- package/src/browsers/index.ts +49 -21
- package/src/browsers/webkit.playwright.ts +4 -4
- package/src/routes/chrome/tests/websocket.spec.ts +2 -2
- package/src/routes/chromium/tests/websocket.spec.ts +2 -2
- package/src/routes/firefox/tests/websocket.spec.ts +2 -4
- package/src/routes/webkit/tests/websocket.spec.ts +2 -3
- package/src/types.ts +1 -1
- package/src/utils.ts +1 -1
- package/static/docs/swagger.json +1 -1
- package/static/docs/swagger.min.json +1 -1
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"description": "Message to be read by screen readers"
|
|
77
77
|
},
|
|
78
78
|
"popupPowerSwitchInfo2": {
|
|
79
|
-
"message": "
|
|
79
|
+
"message": "ಈ ಸೈಟ್ಗಾಗಿ uBlock₀ ಸಕ್ರಿಯಗೊಳಿಸಲು ಕ್ಲಿಕ್ ಮಾಡಿ.",
|
|
80
80
|
"description": "Message to be read by screen readers"
|
|
81
81
|
},
|
|
82
82
|
"popupBlockedRequestPrompt": {
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"description": "Tooltip used for the logger icon in the panel"
|
|
129
129
|
},
|
|
130
130
|
"popupTipReport": {
|
|
131
|
-
"message": "
|
|
131
|
+
"message": "ublock origin ಗೆ ಸಂಬಂಧಿಸಿದ ಈ ವೆಬ್ಸೈಟ್ನಲ್ಲಿ ಸಮಸ್ಯೆಯನ್ನು ವರದಿ ಮಾಡಿ",
|
|
132
132
|
"description": "Tooltip used for the 'chat' icon in the panel"
|
|
133
133
|
},
|
|
134
134
|
"popupTipNoPopups": {
|
|
@@ -180,7 +180,7 @@
|
|
|
180
180
|
"description": "Tooltip for the no-remote-fonts per-site switch"
|
|
181
181
|
},
|
|
182
182
|
"popupTipNoScripting1": {
|
|
183
|
-
"message": "
|
|
183
|
+
"message": "ಈ ಸೈಟ್ನಲ್ಲಿ ಜಾವಾಸ್ಕ್ರಿಪ್ಟ್ ಅನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಲು ಕ್ಲಿಕ್ ಮಾಡಿ",
|
|
184
184
|
"description": "Tooltip for the no-scripting per-site switch"
|
|
185
185
|
},
|
|
186
186
|
"popupTipNoScripting2": {
|
|
@@ -388,7 +388,7 @@
|
|
|
388
388
|
"description": ""
|
|
389
389
|
},
|
|
390
390
|
"settingsNoScriptingPrompt": {
|
|
391
|
-
"message": "
|
|
391
|
+
"message": "ಜಾವಾಸ್ಕ್ರಿಪ್ಟ್ ಅನ್ನು ನಿಷ್ಕ್ರಿಯಗೊಳಿಸಿ",
|
|
392
392
|
"description": "The default state for the per-site no-scripting switch"
|
|
393
393
|
},
|
|
394
394
|
"settingsNoCSPReportsPrompt": {
|
|
@@ -424,7 +424,7 @@
|
|
|
424
424
|
"description": "Appears at the top of the _3rd-party filters_ pane"
|
|
425
425
|
},
|
|
426
426
|
"3pListsOfBlockedHostsPerListStats": {
|
|
427
|
-
"message": "{{
|
|
427
|
+
"message": "{{total}} ರಿಂದ {{used}} ಬಳಸಲುಗುವುತಿದೆ ",
|
|
428
428
|
"description": "Appears aside each filter list in the _3rd-party filters_ pane"
|
|
429
429
|
},
|
|
430
430
|
"3pAutoUpdatePrompt1": {
|
|
@@ -520,7 +520,7 @@
|
|
|
520
520
|
"description": "used as a tooltip for the out-of-date icon beside a list"
|
|
521
521
|
},
|
|
522
522
|
"3pViewContent": {
|
|
523
|
-
"message": "
|
|
523
|
+
"message": "ವಿಷಯವನ್ನು ವೀಕ್ಷಿಸಿ",
|
|
524
524
|
"description": "used as a tooltip for eye icon beside a list"
|
|
525
525
|
},
|
|
526
526
|
"3pLastUpdate": {
|
|
@@ -552,7 +552,7 @@
|
|
|
552
552
|
"description": "Button in the 'My filters' pane"
|
|
553
553
|
},
|
|
554
554
|
"1pExport": {
|
|
555
|
-
"message": "
|
|
555
|
+
"message": "ರಫ್ತು...",
|
|
556
556
|
"description": "Button in the 'My filters' pane"
|
|
557
557
|
},
|
|
558
558
|
"1pExportFilename": {
|
|
@@ -580,7 +580,7 @@
|
|
|
580
580
|
"description": "This will persist temporary rules"
|
|
581
581
|
},
|
|
582
582
|
"rulesEdit": {
|
|
583
|
-
"message": "
|
|
583
|
+
"message": "ತಿದ್ದಿ ",
|
|
584
584
|
"description": "Will enable manual-edit mode (textarea)"
|
|
585
585
|
},
|
|
586
586
|
"rulesEditSave": {
|
|
@@ -660,7 +660,7 @@
|
|
|
660
660
|
"description": "English: URL"
|
|
661
661
|
},
|
|
662
662
|
"logRequestsHeaderFilter": {
|
|
663
|
-
"message": "
|
|
663
|
+
"message": "ಫಿಲ್ಟರ್",
|
|
664
664
|
"description": "English: Filter"
|
|
665
665
|
},
|
|
666
666
|
"logAll": {
|
|
@@ -716,7 +716,7 @@
|
|
|
716
716
|
"description": "Tooltip for the button to bring up logger output filtering options"
|
|
717
717
|
},
|
|
718
718
|
"loggerRowFiltererBuiltinNot": {
|
|
719
|
-
"message": "
|
|
719
|
+
"message": "ಅಲ್ಲದ ",
|
|
720
720
|
"description": "A keyword in the built-in row filtering expression"
|
|
721
721
|
},
|
|
722
722
|
"loggerRowFiltererBuiltinEventful": {
|
|
@@ -780,7 +780,7 @@
|
|
|
780
780
|
"description": "Label to identify the URL of an entry"
|
|
781
781
|
},
|
|
782
782
|
"loggerURLFilteringHeader": {
|
|
783
|
-
"message": "URL
|
|
783
|
+
"message": "URL ನಿಯಮ ",
|
|
784
784
|
"description": "Small header to identify the dynamic URL filtering section"
|
|
785
785
|
},
|
|
786
786
|
"loggerURLFilteringContextLabel": {
|
|
@@ -540,11 +540,11 @@
|
|
|
540
540
|
"description": "Warning against copy-pasting filters from random sources"
|
|
541
541
|
},
|
|
542
542
|
"1pEnableMyFiltersLabel": {
|
|
543
|
-
"message": "
|
|
543
|
+
"message": "Aktiver mine egendefinerte filtre",
|
|
544
544
|
"description": "Label for the checkbox use to enable/disable 'My filters' list"
|
|
545
545
|
},
|
|
546
546
|
"1pTrustMyFiltersLabel": {
|
|
547
|
-
"message": "
|
|
547
|
+
"message": "Tillat egendefinerte filtre som krever tiltro",
|
|
548
548
|
"description": "Label for the checkbox use to trust the content of 'My filters' list"
|
|
549
549
|
},
|
|
550
550
|
"1pImport": {
|
|
@@ -540,11 +540,11 @@
|
|
|
540
540
|
"description": "Warning against copy-pasting filters from random sources"
|
|
541
541
|
},
|
|
542
542
|
"1pEnableMyFiltersLabel": {
|
|
543
|
-
"message": "
|
|
543
|
+
"message": "Aktiver mine egendefinerte filtre",
|
|
544
544
|
"description": "Label for the checkbox use to enable/disable 'My filters' list"
|
|
545
545
|
},
|
|
546
546
|
"1pTrustMyFiltersLabel": {
|
|
547
|
-
"message": "
|
|
547
|
+
"message": "Tillat egendefinerte filtre som krever tiltro",
|
|
548
548
|
"description": "Label for the checkbox use to trust the content of 'My filters' list"
|
|
549
549
|
},
|
|
550
550
|
"1pImport": {
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"description": "For the new mobile-friendly popup design"
|
|
105
105
|
},
|
|
106
106
|
"popupBlockedSinceInstall_v2": {
|
|
107
|
-
"message": "Blockerat sedan
|
|
107
|
+
"message": "Blockerat sedan installation",
|
|
108
108
|
"description": "For the new mobile-friendly popup design"
|
|
109
109
|
},
|
|
110
110
|
"popupDomainsConnected_v2": {
|
|
@@ -540,11 +540,11 @@
|
|
|
540
540
|
"description": "Warning against copy-pasting filters from random sources"
|
|
541
541
|
},
|
|
542
542
|
"1pEnableMyFiltersLabel": {
|
|
543
|
-
"message": "
|
|
543
|
+
"message": "启用自定义过滤规则",
|
|
544
544
|
"description": "Label for the checkbox use to enable/disable 'My filters' list"
|
|
545
545
|
},
|
|
546
546
|
"1pTrustMyFiltersLabel": {
|
|
547
|
-
"message": "
|
|
547
|
+
"message": "允许需信任的自定义过滤规则",
|
|
548
548
|
"description": "Label for the checkbox use to trust the content of 'My filters' list"
|
|
549
549
|
},
|
|
550
550
|
"1pImport": {
|
|
@@ -763,16 +763,11 @@
|
|
|
763
763
|
"content": "filters",
|
|
764
764
|
"group": "regions",
|
|
765
765
|
"off": true,
|
|
766
|
-
"title": "🇳🇱nl 🇧🇪be:
|
|
766
|
+
"title": "🇳🇱nl 🇧🇪be: AdGuard Dutch",
|
|
767
767
|
"tags": "ads afrikaans be belgië frisian dutch flemish nederlands netherlands nl sr suriname za",
|
|
768
768
|
"lang": "af fy nl",
|
|
769
|
-
"contentURL": "https://
|
|
770
|
-
"
|
|
771
|
-
"https://easydutch-ubo.github.io/EasyDutch/EasyDutch.all.txt",
|
|
772
|
-
"https://cdn.jsdelivr.net/gh/EasyDutch-uBO/EasyDutch@gh-pages/EasyDutch.all.txt",
|
|
773
|
-
"https://cdn.statically.io/gh/EasyDutch-uBO/EasyDutch/gh-pages/EasyDutch.all.txt"
|
|
774
|
-
],
|
|
775
|
-
"supportURL": "https://github.com/EasyDutch-uBO/EasyDutch/"
|
|
769
|
+
"contentURL": "https://filters.adtidy.org/extension/ublock/filters/8.txt",
|
|
770
|
+
"supportURL": "https://kb.adguard.com/en/general/adguard-ad-filters"
|
|
776
771
|
},
|
|
777
772
|
"NOR-0": {
|
|
778
773
|
"content": "filters",
|
|
@@ -155,6 +155,12 @@ function safeSelf() {
|
|
|
155
155
|
}, []);
|
|
156
156
|
return this.Object_fromEntries(entries);
|
|
157
157
|
},
|
|
158
|
+
onIdle(fn, options) {
|
|
159
|
+
if ( self.requestIdleCallback ) {
|
|
160
|
+
return self.requestIdleCallback(fn, options);
|
|
161
|
+
}
|
|
162
|
+
return self.requestAnimationFrame(fn);
|
|
163
|
+
},
|
|
158
164
|
};
|
|
159
165
|
scriptletGlobals.safeSelf = safe;
|
|
160
166
|
if ( scriptletGlobals.bcSecret === undefined ) { return safe; }
|
|
@@ -975,7 +981,9 @@ function setCookieFn(
|
|
|
975
981
|
name = encodeURIComponent(name);
|
|
976
982
|
}
|
|
977
983
|
// https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1
|
|
978
|
-
|
|
984
|
+
// The characters [",] are given a pass from the RFC requirements because
|
|
985
|
+
// apparently browsers do not follow the RFC to the letter.
|
|
986
|
+
if ( /[^ -:<-[\]-~]/.test(value) ) {
|
|
979
987
|
value = encodeURIComponent(value);
|
|
980
988
|
}
|
|
981
989
|
|
|
@@ -1045,17 +1053,21 @@ function setLocalStorageItemFn(
|
|
|
1045
1053
|
'false', 'true',
|
|
1046
1054
|
'on', 'off',
|
|
1047
1055
|
'yes', 'no',
|
|
1056
|
+
'accept', 'reject',
|
|
1057
|
+
'accepted', 'rejected',
|
|
1048
1058
|
'{}', '[]', '""',
|
|
1049
1059
|
'$remove$',
|
|
1050
1060
|
];
|
|
1051
1061
|
|
|
1052
1062
|
if ( trusted ) {
|
|
1053
|
-
if ( value
|
|
1054
|
-
value = Date.now();
|
|
1055
|
-
}
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1063
|
+
if ( value.includes('$now$') ) {
|
|
1064
|
+
value = value.replaceAll('$now$', Date.now());
|
|
1065
|
+
}
|
|
1066
|
+
if ( value.includes('$currentDate$') ) {
|
|
1067
|
+
value = value.replaceAll('$currentDate$', `${Date()}`);
|
|
1068
|
+
}
|
|
1069
|
+
if ( value.includes('$currentISODate$') ) {
|
|
1070
|
+
value = value.replaceAll('$currentISODate$', (new Date()).toISOString());
|
|
1059
1071
|
}
|
|
1060
1072
|
} else {
|
|
1061
1073
|
const normalized = value.toLowerCase();
|
|
@@ -2011,12 +2023,19 @@ function noEvalIf(
|
|
|
2011
2023
|
) {
|
|
2012
2024
|
if ( typeof needle !== 'string' ) { return; }
|
|
2013
2025
|
const safe = safeSelf();
|
|
2026
|
+
const logPrefix = safe.makeLogPrefix('noeval-if', needle);
|
|
2014
2027
|
const reNeedle = safe.patternToRegex(needle);
|
|
2015
2028
|
window.eval = new Proxy(window.eval, { // jshint ignore: line
|
|
2016
2029
|
apply: function(target, thisArg, args) {
|
|
2017
|
-
const a = args[0];
|
|
2018
|
-
if ( reNeedle.test(a
|
|
2019
|
-
|
|
2030
|
+
const a = String(args[0]);
|
|
2031
|
+
if ( needle !== '' && reNeedle.test(a) ) {
|
|
2032
|
+
safe.uboLog(logPrefix, 'Prevented:\n', a);
|
|
2033
|
+
return;
|
|
2034
|
+
}
|
|
2035
|
+
if ( needle === '' || safe.logLevel > 1 ) {
|
|
2036
|
+
safe.uboLog(logPrefix, 'Not prevented:\n', a);
|
|
2037
|
+
}
|
|
2038
|
+
return Reflect.apply(target, thisArg, args);
|
|
2020
2039
|
}
|
|
2021
2040
|
});
|
|
2022
2041
|
}
|
|
@@ -2171,18 +2190,24 @@ builtinScriptlets.push({
|
|
|
2171
2190
|
fn: removeAttr,
|
|
2172
2191
|
dependencies: [
|
|
2173
2192
|
'run-at.fn',
|
|
2193
|
+
'safe-self.fn',
|
|
2174
2194
|
],
|
|
2175
2195
|
});
|
|
2176
2196
|
function removeAttr(
|
|
2177
|
-
|
|
2178
|
-
|
|
2197
|
+
rawToken = '',
|
|
2198
|
+
rawSelector = '',
|
|
2179
2199
|
behavior = ''
|
|
2180
2200
|
) {
|
|
2181
|
-
if ( typeof
|
|
2182
|
-
if (
|
|
2183
|
-
const
|
|
2184
|
-
|
|
2185
|
-
|
|
2201
|
+
if ( typeof rawToken !== 'string' ) { return; }
|
|
2202
|
+
if ( rawToken === '' ) { return; }
|
|
2203
|
+
const safe = safeSelf();
|
|
2204
|
+
const logPrefix = safe.makeLogPrefix('remove-attr', rawToken, rawSelector, behavior);
|
|
2205
|
+
const tokens = rawToken.split(/\s*\|\s*/);
|
|
2206
|
+
const selector = tokens
|
|
2207
|
+
.map(a => `${rawSelector}[${CSS.escape(a)}]`)
|
|
2208
|
+
.join(',');
|
|
2209
|
+
if ( safe.logLevel > 1 ) {
|
|
2210
|
+
safe.uboLog(logPrefix, `Target selector:\n\t${selector}`);
|
|
2186
2211
|
}
|
|
2187
2212
|
let timer;
|
|
2188
2213
|
const rmattr = ( ) => {
|
|
@@ -2191,7 +2216,9 @@ function removeAttr(
|
|
|
2191
2216
|
const nodes = document.querySelectorAll(selector);
|
|
2192
2217
|
for ( const node of nodes ) {
|
|
2193
2218
|
for ( const attr of tokens ) {
|
|
2219
|
+
if ( node.hasAttribute(attr) === false ) { continue; }
|
|
2194
2220
|
node.removeAttribute(attr);
|
|
2221
|
+
safe.uboLog(logPrefix, `Removed attribute '${attr}'`);
|
|
2195
2222
|
}
|
|
2196
2223
|
}
|
|
2197
2224
|
} catch(ex) {
|
|
@@ -2211,7 +2238,7 @@ function removeAttr(
|
|
|
2211
2238
|
}
|
|
2212
2239
|
}
|
|
2213
2240
|
if ( skip ) { return; }
|
|
2214
|
-
timer =
|
|
2241
|
+
timer = safe.onIdle(rmattr, { timeout: 67 });
|
|
2215
2242
|
};
|
|
2216
2243
|
const start = ( ) => {
|
|
2217
2244
|
rmattr();
|
|
@@ -2240,27 +2267,34 @@ builtinScriptlets.push({
|
|
|
2240
2267
|
world: 'ISOLATED',
|
|
2241
2268
|
dependencies: [
|
|
2242
2269
|
'run-at.fn',
|
|
2270
|
+
'safe-self.fn',
|
|
2243
2271
|
],
|
|
2244
2272
|
});
|
|
2245
2273
|
function removeClass(
|
|
2246
|
-
|
|
2247
|
-
|
|
2274
|
+
rawToken = '',
|
|
2275
|
+
rawSelector = '',
|
|
2248
2276
|
behavior = ''
|
|
2249
2277
|
) {
|
|
2250
|
-
if ( typeof
|
|
2251
|
-
if (
|
|
2252
|
-
const
|
|
2253
|
-
|
|
2254
|
-
|
|
2278
|
+
if ( typeof rawToken !== 'string' ) { return; }
|
|
2279
|
+
if ( rawToken === '' ) { return; }
|
|
2280
|
+
const safe = safeSelf();
|
|
2281
|
+
const logPrefix = safe.makeLogPrefix('remove-class', rawToken, rawSelector, behavior);
|
|
2282
|
+
const tokens = rawToken.split(/\s*\|\s*/);
|
|
2283
|
+
const selector = tokens
|
|
2284
|
+
.map(a => `${rawSelector}.${CSS.escape(a)}`)
|
|
2285
|
+
.join(',');
|
|
2286
|
+
if ( safe.logLevel > 1 ) {
|
|
2287
|
+
safe.uboLog(logPrefix, `Target selector:\n\t${selector}`);
|
|
2255
2288
|
}
|
|
2256
2289
|
const mustStay = /\bstay\b/.test(behavior);
|
|
2257
2290
|
let timer;
|
|
2258
|
-
const rmclass =
|
|
2291
|
+
const rmclass = ( ) => {
|
|
2259
2292
|
timer = undefined;
|
|
2260
2293
|
try {
|
|
2261
2294
|
const nodes = document.querySelectorAll(selector);
|
|
2262
2295
|
for ( const node of nodes ) {
|
|
2263
|
-
node.classList.remove(...
|
|
2296
|
+
node.classList.remove(...tokens);
|
|
2297
|
+
safe.uboLog(logPrefix, 'Removed class(es)');
|
|
2264
2298
|
}
|
|
2265
2299
|
} catch(ex) {
|
|
2266
2300
|
}
|
|
@@ -2282,7 +2316,7 @@ function removeClass(
|
|
|
2282
2316
|
}
|
|
2283
2317
|
}
|
|
2284
2318
|
if ( skip ) { return; }
|
|
2285
|
-
timer =
|
|
2319
|
+
timer = safe.onIdle(rmclass, { timeout: 67 });
|
|
2286
2320
|
};
|
|
2287
2321
|
const observer = new MutationObserver(mutationHandler);
|
|
2288
2322
|
const start = ( ) => {
|
|
@@ -3268,6 +3302,10 @@ function m3uPrune(
|
|
|
3268
3302
|
};
|
|
3269
3303
|
const pruner = text => {
|
|
3270
3304
|
if ( (/^\s*#EXTM3U/.test(text)) === false ) { return text; }
|
|
3305
|
+
if ( m3uPattern === '' ) {
|
|
3306
|
+
safe.uboLog(` Content:\n${text}`);
|
|
3307
|
+
return text;
|
|
3308
|
+
}
|
|
3271
3309
|
if ( reM3u.multiline ) {
|
|
3272
3310
|
reM3u.lastIndex = 0;
|
|
3273
3311
|
for (;;) {
|
|
@@ -3491,7 +3529,7 @@ function hrefSanitizer(
|
|
|
3491
3529
|
if ( shouldSanitize ) { break; }
|
|
3492
3530
|
}
|
|
3493
3531
|
if ( shouldSanitize === false ) { return; }
|
|
3494
|
-
timer =
|
|
3532
|
+
timer = safe.onIdle(( ) => {
|
|
3495
3533
|
timer = undefined;
|
|
3496
3534
|
sanitize();
|
|
3497
3535
|
});
|
|
@@ -3604,6 +3642,9 @@ function spoofCSS(
|
|
|
3604
3642
|
const cloackFunc = (fn, thisArg, name) => {
|
|
3605
3643
|
const trap = fn.bind(thisArg);
|
|
3606
3644
|
Object.defineProperty(trap, 'name', { value: name });
|
|
3645
|
+
Object.defineProperty(trap, 'toString', {
|
|
3646
|
+
value: ( ) => `function ${name}() { [native code] }`
|
|
3647
|
+
});
|
|
3607
3648
|
return trap;
|
|
3608
3649
|
};
|
|
3609
3650
|
self.getComputedStyle = new Proxy(self.getComputedStyle, {
|
|
@@ -3617,7 +3658,7 @@ function spoofCSS(
|
|
|
3617
3658
|
get(target, prop, receiver) {
|
|
3618
3659
|
if ( typeof target[prop] === 'function' ) {
|
|
3619
3660
|
if ( prop === 'getPropertyValue' ) {
|
|
3620
|
-
return cloackFunc(function(prop) {
|
|
3661
|
+
return cloackFunc(function getPropertyValue(prop) {
|
|
3621
3662
|
return spoofStyle(prop, target[prop]);
|
|
3622
3663
|
}, target, 'getPropertyValue');
|
|
3623
3664
|
}
|
|
@@ -3736,6 +3777,7 @@ function setCookie(
|
|
|
3736
3777
|
'true', 't', 'false', 'f',
|
|
3737
3778
|
'yes', 'y', 'no', 'n',
|
|
3738
3779
|
'necessary', 'required',
|
|
3780
|
+
'approved', 'disapproved',
|
|
3739
3781
|
];
|
|
3740
3782
|
const normalized = value.toLowerCase();
|
|
3741
3783
|
const match = /^("?)(.+)\1$/.exec(normalized);
|
|
@@ -4447,6 +4489,20 @@ function trustedClickElement(
|
|
|
4447
4489
|
}
|
|
4448
4490
|
}
|
|
4449
4491
|
|
|
4492
|
+
const getShadowRoot = elem => {
|
|
4493
|
+
// Firefox
|
|
4494
|
+
if ( elem.openOrClosedShadowRoot ) {
|
|
4495
|
+
return elem.openOrClosedShadowRoot;
|
|
4496
|
+
}
|
|
4497
|
+
// Chromium
|
|
4498
|
+
if ( typeof chrome === 'object' ) {
|
|
4499
|
+
if ( chrome.dom && chrome.dom.openOrClosedShadowRoot ) {
|
|
4500
|
+
return chrome.dom.openOrClosedShadowRoot(elem);
|
|
4501
|
+
}
|
|
4502
|
+
}
|
|
4503
|
+
return null;
|
|
4504
|
+
};
|
|
4505
|
+
|
|
4450
4506
|
const querySelectorEx = (selector, context = document) => {
|
|
4451
4507
|
const pos = selector.indexOf(' >>> ');
|
|
4452
4508
|
if ( pos === -1 ) { return context.querySelector(selector); }
|
|
@@ -4454,7 +4510,7 @@ function trustedClickElement(
|
|
|
4454
4510
|
const inside = selector.slice(pos + 5).trim();
|
|
4455
4511
|
const elem = context.querySelector(outside);
|
|
4456
4512
|
if ( elem === null ) { return null; }
|
|
4457
|
-
const shadowRoot = elem
|
|
4513
|
+
const shadowRoot = getShadowRoot(elem);
|
|
4458
4514
|
return shadowRoot && querySelectorEx(inside, shadowRoot);
|
|
4459
4515
|
};
|
|
4460
4516
|
|
|
@@ -4702,3 +4758,44 @@ function trustedReplaceArgument(
|
|
|
4702
4758
|
}
|
|
4703
4759
|
|
|
4704
4760
|
/******************************************************************************/
|
|
4761
|
+
|
|
4762
|
+
builtinScriptlets.push({
|
|
4763
|
+
name: 'trusted-replace-outbound-text.js',
|
|
4764
|
+
requiresTrust: true,
|
|
4765
|
+
fn: trustedReplaceOutboundText,
|
|
4766
|
+
dependencies: [
|
|
4767
|
+
'proxy-apply.fn',
|
|
4768
|
+
'safe-self.fn',
|
|
4769
|
+
],
|
|
4770
|
+
});
|
|
4771
|
+
function trustedReplaceOutboundText(
|
|
4772
|
+
propChain = '',
|
|
4773
|
+
pattern = '',
|
|
4774
|
+
replacement = '',
|
|
4775
|
+
...args
|
|
4776
|
+
) {
|
|
4777
|
+
if ( propChain === '' ) { return; }
|
|
4778
|
+
const safe = safeSelf();
|
|
4779
|
+
const logPrefix = safe.makeLogPrefix('trusted-replace-outbound-text', propChain, pattern, replacement, ...args);
|
|
4780
|
+
const rePattern = safe.patternToRegex(pattern);
|
|
4781
|
+
const extraArgs = safe.getExtraArgs(args);
|
|
4782
|
+
const reCondition = safe.patternToRegex(extraArgs.condition || '');
|
|
4783
|
+
const reflector = proxyApplyFn(propChain, function(...args) {
|
|
4784
|
+
const textBefore = reflector(...args);
|
|
4785
|
+
if ( pattern === '' ) {
|
|
4786
|
+
safe.uboLog(logPrefix, 'Outbound text:\n', textBefore);
|
|
4787
|
+
return textBefore;
|
|
4788
|
+
}
|
|
4789
|
+
reCondition.lastIndex = 0;
|
|
4790
|
+
if ( reCondition.test(textBefore) === false ) { return textBefore; }
|
|
4791
|
+
const textAfter = textBefore.replace(rePattern, replacement);
|
|
4792
|
+
if ( textAfter === textBefore ) { return textBefore; }
|
|
4793
|
+
safe.uboLog(logPrefix, 'Matched and replaced');
|
|
4794
|
+
if ( safe.logLevel > 1 ) {
|
|
4795
|
+
safe.uboLog(logPrefix, 'Modified outbound text:\n', textAfter);
|
|
4796
|
+
}
|
|
4797
|
+
return textAfter;
|
|
4798
|
+
});
|
|
4799
|
+
}
|
|
4800
|
+
|
|
4801
|
+
/******************************************************************************/
|