-
Notifications
You must be signed in to change notification settings - Fork 0
/
ehg-exh-automatically-open-original-images-in-backgrounded-tabs.user.js
98 lines (95 loc) · 3.43 KB
/
ehg-exh-automatically-open-original-images-in-backgrounded-tabs.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// ==UserScript==
// @name Automatically open original images in background tabs
// @namespace dragontamer8740.xTabAutoOrig
// @description Load original images if tabs are backgrounded after 3 seconds. Hooks off of the hotkey script, so must execute after it.
// @version 1
// @include https://exhentai.org/s/*
// @include http://exhentai.org/s/*
// @include https://e-hentai.org/s/*
// @include http://e-hentai.org/s/*
// @include https://exhentai.org/g/*
// @include http://exhentai.org/g/*
// @include https://e-hentai.org/g/*
// @include http://e-hentai.org/g/*
// @include http://exhentai.org/*
// @include https://exhentai.org/*
// @include http://exhentai55ld2wyap5juskbm67czulomrouspdacjamjeloj7ugjbsad.onion/*
// @include http://rule34.xxx/index.php*
// @include https://rule34.xxx/index.php*
// @include http://rule34.us/index.php?r=posts/view*
// @include https://rule34.us/index.php?r=posts/view*
// @include http://rule*.paheal.net/post/view/*
// @include https://rule*.paheal.net/post/view/*
// @include http://e621.net/post/show/*
// @include https://e621.net/post/show/*
// @include http://e621.net/posts/*
// @include https://e621.net/posts/*
// @include http://chan.sankakucomplex.com/post/show/*
// @include https://chan.sankakucomplex.com/post/show/*
// @include http://*.furaffinity.net/view/*/
// @include https://*.furaffinity.net/view/*/
// @include http://*.furaffinity.net/full/*/
// @include https://*.furaffinity.net/full/*/
// @include http://*.furaffinity.net/gallery/*/
// @include https://*.furaffinity.net/gallery/*/
// @include http://*.weasyl.com/*/submissions/*
// @include https://*.weasyl.com/*/submissions/*
// @include http://*.weasyl.com/*/submissions/*/*
// @include https://*.weasyl.com/*/submissions/*/*
// @include http://derpibooru.org/images/*
// @include https://derpibooru.org/images/*
// @grant unsafeWindow
// ==/UserScript==
// unsafeWindow allows us to call scripts exported by hotkey script.
// we only allow things other than the basic ehg/s/ stuff so that we can turn off the script from the menu while anywhere on the site
function doFocusCheckOpen() {
if(!document.hasFocus())
{
unsafeWindow.openImgHere();
}
}
// setInterval(doFocusCheck, 2000);
var urlwoprot=window.location.href.replace(/(^\w+:|^)\/\//, '');
if(urlwoprot.startsWith("exhentai.org/s/") | urlwoprot.startsWith("e-hentai.org/s/"))
{
setTimeout(doFocusCheckOpen, 1500);
}
else if( window.location.origin.endsWith("rule34.xxx"))
{
if(/\?s\=view|&s\=view/i.test(window.location.href) )
{
setTimeout(doFocusCheckOpen, 3000);
}
}
else if(urlwoprot.startsWith("e621.net/posts/"))
{
setTimeout(doFocusCheckOpen, 1500);
}
else if (urlwoprot.startsWith("chan.sankakucomplex.com"))
{
setTimeout(doFocusCheckOpen, 2250);
}
else if (urlwoprot.startsWith("derpibooru.org/images/"))
{
setTimeout(doFocusCheckOpen, 2500);
}
else if (urlwoprot.startsWith("www.furaffinity.net/view/"))
{
setTimeout(doFocusCheckOpen, 1500);
}
else if(window.location.origin.endsWith("weasyl.com"))
{
setTimeout(doFocusCheckOpen, 3000);
}
else /* default */
{
setTimeout(doFocusCheckOpen, 1500);
}
if(document.title=="503 Backend fetch failed")
{
setTimeout(function(){ location.reload(); }, 2*1000);
}
else if (document.title=="I Just Don't Know What Went Wrong")
{
setTimeout(function(){ location.reload(); }, 2*1000);
}