Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name 4chan Block Fix
- // @namespace b4k
- // @version 1.0.0
- // @match *://boards.4chan.org/*
- // @match *://sys.4chan.org/*
- // @run-at document-start
- // @grant unsafeWindow
- // ==/UserScript==
- (function () {
- var window;
- var process;
- var interval;
- var domloaded;
- window =
- unsafeWindow;
- domloaded = false;
- process = function () {
- var scripts;
- var domevent;
- scripts =
- document.querySelectorAll("script");
- scripts.forEach(
- function (script) {
- if (!script.src && script.innerHTML) {
- if (!script.getAttribute("x-done")) {
- script.setAttribute("x-done", "");
- if (script.innerHTML.match(/(style_group|fourcat|recaptcha|pass_enabled)/)) {
- window.eval(script.innerHTML);
- }
- }
- }
- }
- );
- if (domloaded) {
- if (window.initStyleSheet) {
- if (!window.activeStyleSheet) {
- window.initStyleSheet();
- }
- }
- if (window.Main) {
- if (window.Main.now && !window.Main.type) {
- window.Main.init();
- }
- }
- domevent = document.createEvent("Event");
- domevent.initEvent("DOMContentLoaded", true, true);
- document.dispatchEvent(domevent);
- }
- };
- process();
- interval =
- setInterval(
- function () {
- process();
- if (domloaded) {
- clearInterval(interval);
- }
- },
- ( 3 )
- );
- document.addEventListener(
- "DOMContentLoaded",
- function (event) {
- domloaded = true;
- }
- );
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement