diff --git a/src/data/surrogates.js b/src/data/surrogates.js index 54ca250d3b..814457d4be 100644 --- a/src/data/surrogates.js +++ b/src/data/surrogates.js @@ -133,6 +133,10 @@ const hostnames = { ], widgetName: "YouTube" }, + 'cdn.intergient.com': { + match: MATCH_SUFFIX, + tokens: ['/ramp_core.js'], + } }; /** @@ -177,6 +181,8 @@ const surrogates = { '/player_api': 'youtube.js', '/omweb-v1.js': 'noop.js', + + '/ramp_core.js': 'ramp.js', 'noopjs': 'noop.js' }; @@ -194,4 +200,4 @@ export default { MATCH_SUFFIX, hostnames, surrogates, -}; +}; \ No newline at end of file diff --git a/src/data/web_accessible_resources/ramp.js b/src/data/web_accessible_resources/ramp.js new file mode 100644 index 0000000000..dbe873d660 --- /dev/null +++ b/src/data/web_accessible_resources/ramp.js @@ -0,0 +1,17 @@ +// https://developers.playwire.com/api/docs/ads/getting-started-ads.html +// https://github.com/EFForg/privacybadger/pull/2865#issuecomment-1355151256 +(function () { + function noopfn() {} + function checkForOnReady() { + if (!window.ramp) { + window.ramp = {}; + } + window.ramp.addUnits = () => new Promise(noopfn); + window.ramp.displayUnits = noopfn; + window.ramp.destroyUnits = noopfn; + if (typeof window.ramp.onReady == "function") { + window.ramp.onReady(); + } + } + setTimeout(checkForOnReady, 10); +})();