Wikia ad skipper

Skips the "skip this ad" screen when leaving wikia.com to an external page

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Wikia ad skipper
// @namespace    https://github.com/AlorelUserscripts/wikia-remove-intersitial-modal
// @homepage     https://github.com/AlorelUserscripts/wikia-remove-intersitial-modal
// @supportURL   https://github.com/AlorelUserscripts/wikia-remove-intersitial-modal/issues
// @author       Alorel <[email protected]>
// @version      1.0.3
// @description  Skips the "skip this ad" screen when leaving wikia.com to an external page
// @author       Alorel <[email protected]>
// @icon         https://cdn.jsdelivr.net/gh/AlorelUserscripts/[email protected]/ico.png
// @include      http*://*.wikia.com*
// @grant        GM_openInTab
// @run-at       document-end
// @license      LGPL-2.1
// ==/UserScript==

(function () {
    'use strict';
    var main = function () {
        (function () {
            var elements = document.querySelectorAll([
                    ".exitstitial",
                    ".external",
                    ".exitw"
                ].join(",")),
                callback = function (e) {
                    e.preventDefault();
                    GM_openInTab(this.getAttribute("href"), e.ctrlKey || 1 === e.button);
                },
                i = 0;
            for (; i < elements.length; i++) {
                elements[i].addEventListener("click", callback);
            }
        })();

        (function () {
            var css = document.createElement("style");
            css.innerText = [
                    ".blackout",
                    "#ExitstitialInfobox"
                ].join(",") + '{display:none!important}';
            document.body.appendChild(css);
        })();
    };

    if ('loading' !== document.readyState) {
        main();
    } else {
        document.addEventListener('DOMContentLoaded', main);
    }
})();