Add scriptlet aliases for compatibility with AdGuard lists

Related issue:
https://github.com/uBlockOrigin/uBlock-issues/issues/2828
This commit is contained in:
Raymond Hill 2023-09-28 10:07:03 -04:00
parent c3cd596175
commit 4e2aa3e384
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 21 additions and 12 deletions

View File

@ -1441,11 +1441,12 @@ function evaldataPrune(
/******************************************************************************/ /******************************************************************************/
builtinScriptlets.push({ builtinScriptlets.push({
name: 'nano-setInterval-booster.js', name: 'adjust-setInterval.js',
aliases: [ aliases: [
'nano-setInterval-booster.js',
'nano-sib.js', 'nano-sib.js',
], ],
fn: nanoSetIntervalBooster, fn: adjustSetInterval,
dependencies: [ dependencies: [
'safe-self.fn', 'safe-self.fn',
], ],
@ -1462,7 +1463,7 @@ builtinScriptlets.push({
// boostRatio - The delay multiplier when there is a match, 0.5 speeds up by // boostRatio - The delay multiplier when there is a match, 0.5 speeds up by
// 2 times and 2 slows down by 2 times, defaults to 0.05 or speed up // 2 times and 2 slows down by 2 times, defaults to 0.05 or speed up
// 20 times. Speed up and down both cap at 50 times. // 20 times. Speed up and down both cap at 50 times.
function nanoSetIntervalBooster( function adjustSetInterval(
needleArg = '', needleArg = '',
delayArg = '', delayArg = '',
boostArg = '' boostArg = ''
@ -1493,11 +1494,12 @@ function nanoSetIntervalBooster(
/******************************************************************************/ /******************************************************************************/
builtinScriptlets.push({ builtinScriptlets.push({
name: 'nano-setTimeout-booster.js', name: 'adjust-setTimeout.js',
aliases: [ aliases: [
'nano-setTimeout-booster.js',
'nano-stb.js', 'nano-stb.js',
], ],
fn: nanoSetTimeoutBooster, fn: adjustSetTimeout,
dependencies: [ dependencies: [
'safe-self.fn', 'safe-self.fn',
], ],
@ -1515,7 +1517,7 @@ builtinScriptlets.push({
// boostRatio - The delay multiplier when there is a match, 0.5 speeds up by // boostRatio - The delay multiplier when there is a match, 0.5 speeds up by
// 2 times and 2 slows down by 2 times, defaults to 0.05 or speed up // 2 times and 2 slows down by 2 times, defaults to 0.05 or speed up
// 20 times. Speed up and down both cap at 50 times. // 20 times. Speed up and down both cap at 50 times.
function nanoSetTimeoutBooster( function adjustSetTimeout(
needleArg = '', needleArg = '',
delayArg = '', delayArg = '',
boostArg = '' boostArg = ''
@ -1650,15 +1652,18 @@ function noFetchIf(
/******************************************************************************/ /******************************************************************************/
builtinScriptlets.push({ builtinScriptlets.push({
name: 'refresh-defuser.js', name: 'prevent-refresh.js',
fn: refreshDefuser, aliases: [
'refresh-defuser.js',
],
fn: preventRefresh,
world: 'ISOLATED', world: 'ISOLATED',
dependencies: [ dependencies: [
'run-at.fn', 'run-at.fn',
], ],
}); });
// https://www.reddit.com/r/uBlockOrigin/comments/q0frv0/while_reading_a_sports_article_i_was_redirected/hf7wo9v/ // https://www.reddit.com/r/uBlockOrigin/comments/q0frv0/while_reading_a_sports_article_i_was_redirected/hf7wo9v/
function refreshDefuser( function preventRefresh(
arg1 = '' arg1 = ''
) { ) {
if ( typeof arg1 !== 'string' ) { return; } if ( typeof arg1 !== 'string' ) { return; }
@ -2294,8 +2299,12 @@ function noWindowOpenIf(
/******************************************************************************/ /******************************************************************************/
builtinScriptlets.push({ builtinScriptlets.push({
name: 'window-close-if.js', name: 'close-window.js',
fn: windowCloseIf, aliases: [
'window-close-if.js',
],
fn: closeWindow,
world: 'ISOLATED',
dependencies: [ dependencies: [
'safe-self.fn', 'safe-self.fn',
], ],
@ -2303,7 +2312,7 @@ builtinScriptlets.push({
// https://github.com/uBlockOrigin/uAssets/issues/10323#issuecomment-992312847 // https://github.com/uBlockOrigin/uAssets/issues/10323#issuecomment-992312847
// https://github.com/AdguardTeam/Scriptlets/issues/158 // https://github.com/AdguardTeam/Scriptlets/issues/158
// https://github.com/uBlockOrigin/uBlock-issues/discussions/2270 // https://github.com/uBlockOrigin/uBlock-issues/discussions/2270
function windowCloseIf( function closeWindow(
arg1 = '' arg1 = ''
) { ) {
if ( typeof arg1 !== 'string' ) { return; } if ( typeof arg1 !== 'string' ) { return; }