Bad Dragon White Page Fix

Workaround for the white page bug on Bad Dragon.

Verze ze dne 15. 09. 2021. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Bad Dragon White Page Fix
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Workaround for the white page bug on Bad Dragon.
// @author       tikutaro
// @match        *://bad-dragon.com/*
// @icon         https://www.google.com/s2/favicons?domain=bad-dragon.com
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    const head = document.getElementsByTagName('head')[0];
    const exp = /.*\:\/\/.*\.cloudfront\.net\/media-.*\.js/;
    for (const child of head.getElementsByTagName('script')) {
        if (exp.test(child.src)) {
            const tag = document.createElement('script');
            tag.setAttribute('type', 'text/javascript');
            tag.setAttribute('src', child.src);
            head.appendChild(tag);
        }
    }
})();