Bad Dragon White/Blank Page Fix

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

  1. // ==UserScript==
  2. // @name Bad Dragon White/Blank Page Fix
  3. // @namespace https://greasyfork.org/en/scripts/432440-bad-dragon-white-blank-page-fix
  4. // @version 0.1.5
  5. // @description Workaround for the white page & blank page bugs on Bad Dragon.
  6. // @author tikutaro
  7. // @match *://bad-dragon.com/*
  8. // @icon https://www.google.com/s2/favicons?domain=bad-dragon.com
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14. const exp = /.*\:\/\/.*\.cloudfront\.net\/(app|media)-.*\.js/;
  15. const scripts = [];
  16. for (const child of document.getElementsByTagName('script')) {
  17. if (exp.test(child.src)) {
  18. scripts.push(child.src);
  19. }
  20. }
  21. const head = document.getElementsByTagName('head')[0];
  22. for (const url of scripts) {
  23. const tag = document.createElement('script');
  24. tag.setAttribute('type', 'text/javascript');
  25. tag.setAttribute('src', url);
  26. head.appendChild(tag);
  27. }
  28. })();