diff --git a/src/web_accessible_resources/amazon_apstag.js b/src/web_accessible_resources/amazon_apstag.js index ea45541c0..1ddd5a44d 100644 --- a/src/web_accessible_resources/amazon_apstag.js +++ b/src/web_accessible_resources/amazon_apstag.js @@ -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([]); @@ -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); + } })();