mirror of https://github.com/gorhill/uBlock.git
Fix type in variable name
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/2570
This commit is contained in:
parent
a7c479083f
commit
b5d78a07bf
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Externally added to the private namespace in which scriptlets execute.
|
// Externally added to the private namespace in which scriptlets execute.
|
||||||
/* global sriptletGlobals */
|
/* global scriptletGlobals */
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -42,15 +42,15 @@ builtinScriptlets.push({
|
||||||
fn: safeSelf,
|
fn: safeSelf,
|
||||||
});
|
});
|
||||||
function safeSelf() {
|
function safeSelf() {
|
||||||
if ( sriptletGlobals.has('safeSelf') ) {
|
if ( scriptletGlobals.has('safeSelf') ) {
|
||||||
return sriptletGlobals.get('safeSelf');
|
return scriptletGlobals.get('safeSelf');
|
||||||
}
|
}
|
||||||
const safe = {
|
const safe = {
|
||||||
'RegExp': self.RegExp,
|
'RegExp': self.RegExp,
|
||||||
'RegExp_test': self.RegExp.prototype.test,
|
'RegExp_test': self.RegExp.prototype.test,
|
||||||
'RegExp_exec': self.RegExp.prototype.exec,
|
'RegExp_exec': self.RegExp.prototype.exec,
|
||||||
};
|
};
|
||||||
sriptletGlobals.set('safeSelf', safe);
|
scriptletGlobals.set('safeSelf', safe);
|
||||||
return safe;
|
return safe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,10 +110,14 @@ builtinScriptlets.push({
|
||||||
// Issues to mind before changing anything:
|
// Issues to mind before changing anything:
|
||||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/2154
|
// https://github.com/uBlockOrigin/uBlock-issues/issues/2154
|
||||||
function abortCurrentScript(
|
function abortCurrentScript(
|
||||||
target = '',
|
arg1 = '',
|
||||||
needle = '',
|
arg2 = '',
|
||||||
context = ''
|
arg3 = ''
|
||||||
) {
|
) {
|
||||||
|
const details = typeof arg1 !== 'object'
|
||||||
|
? { target: arg1, needle: arg2, context: arg3 }
|
||||||
|
: arg1;
|
||||||
|
const { target, needle, context } = details;
|
||||||
if ( typeof target !== 'string' ) { return; }
|
if ( typeof target !== 'string' ) { return; }
|
||||||
if ( target === '' ) { return; }
|
if ( target === '' ) { return; }
|
||||||
const reNeedle = patternToRegex(needle);
|
const reNeedle = patternToRegex(needle);
|
||||||
|
|
|
@ -393,7 +393,7 @@ scriptletFilteringEngine.retrieve = function(request, options = {}) {
|
||||||
µb.hiddenSettings.debugScriptlets ? 'debugger;' : ';',
|
µb.hiddenSettings.debugScriptlets ? 'debugger;' : ';',
|
||||||
'',
|
'',
|
||||||
// For use by scriptlets to share local data among themselves
|
// For use by scriptlets to share local data among themselves
|
||||||
'const sriptletGlobals = new Map();',
|
'const scriptletGlobals = new Map();',
|
||||||
'',
|
'',
|
||||||
cacheDetails.code,
|
cacheDetails.code,
|
||||||
'',
|
'',
|
||||||
|
|
Loading…
Reference in New Issue