-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwikia-skip-ad.user.js
53 lines (50 loc) · 2.06 KB
/
wikia-skip-ad.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// ==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*
// @downloadURL https://raw.githubusercontent.com/AlorelUserscripts/wikia-remove-intersitial-modal/master/wikia-skip-ad.user.js
// @updateURL https://raw.githubusercontent.com/AlorelUserscripts/wikia-remove-intersitial-modal/master/wikia-skip-ad.meta.js
// @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);
}
})();