Bad Dragon White/Blank Page Fix

Workaround for the white page & blank page bugs on Bad Dragon.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Bad Dragon White/Blank Page Fix
// @namespace    https://greasyfork.org/en/scripts/432440-bad-dragon-white-blank-page-fix
// @version      0.1.5
// @description  Workaround for the white page & blank page bugs 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 exp = /.*\:\/\/.*\.cloudfront\.net\/(app|media)-.*\.js/;
    const scripts = [];
    for (const child of document.getElementsByTagName('script')) {
        if (exp.test(child.src)) {
            scripts.push(child.src);
        }
    }
    const head = document.getElementsByTagName('head')[0];
    for (const url of scripts) {
        const tag = document.createElement('script');
        tag.setAttribute('type', 'text/javascript');
        tag.setAttribute('src', url);
        head.appendChild(tag);
    }
})();