Skip to content

Commit

Permalink
Support the empty string value in set-constant scriptlet
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Jan 5, 2019
1 parent fbf4b56 commit 5051610
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions filters/resources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2129,6 +2129,8 @@ set-constant.js application/javascript
cValue = parseFloat(cValue);
if ( isNaN(cValue) ) { return; }
if ( Math.abs(cValue) > 0x7FFF ) { return; }
} else if ( cValue === '' ) {
// empty string constant supported
} else {
return;
}
Expand Down Expand Up @@ -2183,6 +2185,7 @@ set-constant.js application/javascript
makeProxy(owner, chain);
})();


# Imported from:
# https://github.com/NanoAdblocker/NanoFilters/blob/1f3be7211bb0809c5106996f52564bf10c4525f7/NanoFiltersSource/NanoResources.txt#L82
#
Expand Down Expand Up @@ -2300,28 +2303,28 @@ remove-attr.js application/javascript

damoh-defuser.js application/javascript
(function() {
var handled = new WeakSet();
var asyncTimer;
var cleanVideo = function() {
asyncTimer = undefined;
var v = document.querySelector('video');
if ( v === null ) { return; }
if ( handled.has(v) ) { return; }
handled.add(v);
v.pause();
v.controls = true;
var el = v.querySelector('meta[itemprop="contentURL"][content]');
if ( el === null ) { return; }
v.src = el.getAttribute('content');
el = v.querySelector('meta[itemprop="thumbnailUrl"][content]');
if ( el !== null ) { v.poster = el.getAttribute('content'); }
};
var cleanVideoAsync = function() {
if ( asyncTimer !== undefined ) { return; }
asyncTimer = window.requestAnimationFrame(cleanVideo);
};
var observer = new MutationObserver(cleanVideoAsync);
observer.observe(document.documentElement, { childList: true, subtree: true });
var handled = new WeakSet();
var asyncTimer;
var cleanVideo = function() {
asyncTimer = undefined;
var v = document.querySelector('video');
if ( v === null ) { return; }
if ( handled.has(v) ) { return; }
handled.add(v);
v.pause();
v.controls = true;
var el = v.querySelector('meta[itemprop="contentURL"][content]');
if ( el === null ) { return; }
v.src = el.getAttribute('content');
el = v.querySelector('meta[itemprop="thumbnailUrl"][content]');
if ( el !== null ) { v.poster = el.getAttribute('content'); }
};
var cleanVideoAsync = function() {
if ( asyncTimer !== undefined ) { return; }
asyncTimer = window.requestAnimationFrame(cleanVideo);
};
var observer = new MutationObserver(cleanVideoAsync);
observer.observe(document.documentElement, { childList: true, subtree: true });
})();


Expand Down Expand Up @@ -2369,13 +2372,13 @@ twitch-videoad.js application/javascript
# https://github.com/uBlockOrigin/uAssets/issues/2912
fingerprint2.js application/javascript
(function() {
let fp2 = function(){};
fp2.prototype = {
get: function(cb) {
setTimeout(function() { cb('', []); }, 1);
}
};
window.Fingerprint2 = fp2;
let fp2 = function(){};
fp2.prototype = {
get: function(cb) {
setTimeout(function() { cb('', []); }, 1);
}
};
window.Fingerprint2 = fp2;
})();


Expand Down

0 comments on commit 5051610

Please sign in to comment.