Skip to content

Commit 5051610

Browse files
committed
Support the empty string value in set-constant scriptlet
1 parent fbf4b56 commit 5051610

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

filters/resources.txt

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2129,6 +2129,8 @@ set-constant.js application/javascript
21292129
cValue = parseFloat(cValue);
21302130
if ( isNaN(cValue) ) { return; }
21312131
if ( Math.abs(cValue) > 0x7FFF ) { return; }
2132+
} else if ( cValue === '' ) {
2133+
// empty string constant supported
21322134
} else {
21332135
return;
21342136
}
@@ -2183,6 +2185,7 @@ set-constant.js application/javascript
21832185
makeProxy(owner, chain);
21842186
})();
21852187

2188+
21862189
# Imported from:
21872190
# https://github.com/NanoAdblocker/NanoFilters/blob/1f3be7211bb0809c5106996f52564bf10c4525f7/NanoFiltersSource/NanoResources.txt#L82
21882191
#
@@ -2300,28 +2303,28 @@ remove-attr.js application/javascript
23002303

23012304
damoh-defuser.js application/javascript
23022305
(function() {
2303-
var handled = new WeakSet();
2304-
var asyncTimer;
2305-
var cleanVideo = function() {
2306-
asyncTimer = undefined;
2307-
var v = document.querySelector('video');
2308-
if ( v === null ) { return; }
2309-
if ( handled.has(v) ) { return; }
2310-
handled.add(v);
2311-
v.pause();
2312-
v.controls = true;
2313-
var el = v.querySelector('meta[itemprop="contentURL"][content]');
2314-
if ( el === null ) { return; }
2315-
v.src = el.getAttribute('content');
2316-
el = v.querySelector('meta[itemprop="thumbnailUrl"][content]');
2317-
if ( el !== null ) { v.poster = el.getAttribute('content'); }
2318-
};
2319-
var cleanVideoAsync = function() {
2320-
if ( asyncTimer !== undefined ) { return; }
2321-
asyncTimer = window.requestAnimationFrame(cleanVideo);
2322-
};
2323-
var observer = new MutationObserver(cleanVideoAsync);
2324-
observer.observe(document.documentElement, { childList: true, subtree: true });
2306+
var handled = new WeakSet();
2307+
var asyncTimer;
2308+
var cleanVideo = function() {
2309+
asyncTimer = undefined;
2310+
var v = document.querySelector('video');
2311+
if ( v === null ) { return; }
2312+
if ( handled.has(v) ) { return; }
2313+
handled.add(v);
2314+
v.pause();
2315+
v.controls = true;
2316+
var el = v.querySelector('meta[itemprop="contentURL"][content]');
2317+
if ( el === null ) { return; }
2318+
v.src = el.getAttribute('content');
2319+
el = v.querySelector('meta[itemprop="thumbnailUrl"][content]');
2320+
if ( el !== null ) { v.poster = el.getAttribute('content'); }
2321+
};
2322+
var cleanVideoAsync = function() {
2323+
if ( asyncTimer !== undefined ) { return; }
2324+
asyncTimer = window.requestAnimationFrame(cleanVideo);
2325+
};
2326+
var observer = new MutationObserver(cleanVideoAsync);
2327+
observer.observe(document.documentElement, { childList: true, subtree: true });
23252328
})();
23262329

23272330

@@ -2369,13 +2372,13 @@ twitch-videoad.js application/javascript
23692372
# https://github.com/uBlockOrigin/uAssets/issues/2912
23702373
fingerprint2.js application/javascript
23712374
(function() {
2372-
let fp2 = function(){};
2373-
fp2.prototype = {
2374-
get: function(cb) {
2375-
setTimeout(function() { cb('', []); }, 1);
2376-
}
2377-
};
2378-
window.Fingerprint2 = fp2;
2375+
let fp2 = function(){};
2376+
fp2.prototype = {
2377+
get: function(cb) {
2378+
setTimeout(function() { cb('', []); }, 1);
2379+
}
2380+
};
2381+
window.Fingerprint2 = fp2;
23792382
})();
23802383

23812384

0 commit comments

Comments
 (0)