From e62604f889a8bbe68a0dbbc09a5b946f35d417cb Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Fri, 5 Aug 2022 11:26:23 -0400 Subject: [PATCH] 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. --- src/web_accessible_resources/amazon_apstag.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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); + } })();