Skip to content

Commit

Permalink
Add new scriptlet to allow blocking Amazon's apstag.js
Browse files Browse the repository at this point in the history
Related issues:
- NanoMeow/QuickReports#3717
- https://www.reddit.com/r/uBlockOrigin/comments/ghjqph/

The specific issue on the mentioned site is that the
site's code expect `window.apstag.fetchBids` to call
client-supplied function. The new scriptlet defuse this
by calling the client code with an empty array.
  • Loading branch information
gorhill authored and JustOff committed Jun 18, 2020
1 parent 14adfa6 commit 105578d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions assets/resources/resources.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2058,3 +2058,22 @@ ampproject.org/v0.js application/javascript
].join('\n');
head.appendChild(style);
})();


# https://github.com/gorhill/uBlock/commit/f842ab6d3c1cf0394f95d27092bf59627262da40
amazon_apstag.js application/javascript
(function() {
let w = window;
let noopfn = function() { ; }.bind();
let apstag = {
fetchBids: function(a, b) {
if ( b instanceof Function ) {
b([]);
}
},
init: noopfn,
setDisplayBids: noopfn,
targetingKeys: noopfn,
};
w.apstag = apstag;
})();

0 comments on commit 105578d

Please sign in to comment.