Greasy Fork

Rock Paper Shotgun [RPS] & Eurogamer embed fix

Enable embedded third party content on RPS & Eurogamer despite having rejected cookies

目前为 2023-04-14 提交的版本。查看 最新版本

// ==UserScript==
// @name         Rock Paper Shotgun [RPS] & Eurogamer embed fix
// @version      5
// @description  Enable embedded third party content on RPS & Eurogamer despite having rejected cookies
// @author       Tim Smith
// @license      GPL-3.0 License
// @namespace    https://greasyfork.org/users/945293
// @match        *://www.rockpapershotgun.com/*
// @match        *://www.eurogamer.net/*
// ==/UserScript==

(function() {

const sources = [
    'embed.acast.com',
    'bandcamp.com',
    'docs.google.com',
    'gfycat.com',
    'giphy.com',
    'libsyn.com',
    'megaphone.fm',
    'redditmedia.com',
    'soundcloud.com',
    'twitch.tv',
    'youtube'
];
const selectors = sources.map(source => 'iframe[data-src*="'+source+'"]');
document.querySelectorAll(selectors.join()).forEach(iFrame => {
    iFrame.src = iFrame.dataset.src;
});

if (document.querySelector('blockquote.twitter-tweet') !== null) {
    const widgetScript = document.createElement('script');
    widgetScript.async = true;
    widgetScript.src = 'https://platform.twitter.com/widgets.js';
    widgetScript.charset = 'utf-8';
    document.head.appendChild(widgetScript);
}

document.querySelectorAll('script[data-src*="apester.com"]').forEach(script => {
    script.src = script.dataset.src;
});

})();