1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-10-04 16:47:15 +02:00

Add queue-related initialization code to AMZN shim script

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.
This commit is contained in:
Raymond Hill 2022-08-05 11:26:23 -04:00
parent db992b6f4a
commit e62604f889
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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);
}
})();