Skip to content

Commit

Permalink
Add queue-related initialization code to AMZN shim script
Browse files Browse the repository at this point in the history
This would render obsolete the AMZN-related exception at the
following URL:

https://play.mylifetime.com/shows/married-at-first-sight/season-15/episode-1

And possibly lower the likelihood of breakage on other sites.
  • Loading branch information
gorhill committed Aug 5, 2022
1 parent db992b6 commit e62604f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/web_accessible_resources/amazon_apstag.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,18 @@
// https://github.com/NanoMeow/QuickReports/issues/3717
// https://www.reddit.com/r/uBlockOrigin/comments/qyx7en/

// https://searchfox.org/mozilla-central/source/browser/extensions/webcompat/shims/apstag.js
// Import queue-related initialization code.

(function() {
'use strict';
const w = window;
const noopfn = function() {
; // jshint ignore:line
}.bind();
const _Q = w.apstag && w.apstag._Q || [];
const apstag = {
_Q,
fetchBids: function(a, b) {
if ( typeof b === 'function' ) {
b([]);
Expand All @@ -40,4 +45,18 @@
targetingKeys: noopfn,
};
w.apstag = apstag;
_Q.push = function(prefix, args) {
try {
switch (prefix) {
case 'f':
apstag.fetchBids(...args);
break;
}
} catch (e) {
console.trace(e);
}
};
for ( const cmd of _Q ) {
_Q.push(cmd);
}
})();

0 comments on commit e62604f

Please sign in to comment.