-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathntywebtimer.user.js
More file actions
128 lines (111 loc) · 6.19 KB
/
ntywebtimer.user.js
File metadata and controls
128 lines (111 loc) · 6.19 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
// ==UserScript==
// @name Fast-forward Timer on Website
// @namespace https://github.com/itsShiroharu/NTYwebTimer
// @version 1.0
// @description Skips or speeds up artificial wait + cursor-wait animations
// @author Shengwei Xiong
// @match *://*.khaddavi.net/*
// @match *://*.cararegistrasi.com/*
// @match *://*.assessschisma.com/*
// @match *://*.revenuecpmgate.com/*
// @grant none
// @run-at document-start
// ==/UserScript==
// ─────────────────────────────────────────────────────────────────── //
// Hey there. Before you run on TamperMonkey, be sure to change the //
// website written on @match to your desired website domain. Otherwise //
// the script won't start. Good Luck. //
// ─────────────────────────────────────────────────────────────────── //
(function() {
'use strict';
const SPEEDUP = 200; // Speeds up 200x, from 10s to 2s
// Change the value as you wish
// ──────────────────────────────────────────────────────────────── //
// Very aggressive setTimeout / setInterval monkey-patch //
// ──────────────────────────────────────────────────────────────── //
const originalSetTimeout = window.setTimeout;
const originalSetInterval = window.setInterval;
window.setTimeout = function(callback, delay, ...args) {
if (typeof delay === 'number' && delay >= 800 && delay <= 15000) {
console.log("[fastwait] speeding up setTimeout from", delay, "→", delay/SPEEDUP);
return originalSetTimeout(callback, Math.max(1, delay / SPEEDUP), ...args);
}
return originalSetTimeout(callback, delay, ...args);
};
window.setInterval = function(callback, delay, ...args) {
if (typeof delay === 'number' && delay >= 800 && delay <= 15000) {
console.log("[fastwait] speeding up setInterval from", delay, "→", delay/SPEEDUP);
return originalSetInterval(callback, Math.max(1, delay / SPEEDUP), ...args);
}
return originalSetInterval(callback, delay, ...args);
};
// Also patch Promise-based delays
const originalThen = Promise.prototype.then;
Promise.prototype.then = function(onFulfilled, onRejected) {
if (typeof onFulfilled === 'function') {
const originalFn = onFulfilled;
onFulfilled = function(...args) {
if (this instanceof Promise && args.length === 0) {
return originalFn.apply(this, args);
}
return originalFn.apply(this, args);
};
}
return originalThen.call(this, onFulfilled, onRejected);
};
// ──────────────────────────────────────────────────────────────── //
// Force-enable & click the button as soon as it appears //
// ──────────────────────────────────────────────────────────────── //
function tryActivateButton() {
document.querySelectorAll('a.cursor-wait, a.bg-[#1A56DB]\\/70, a:not([href]):not([data-href])').forEach(el => {
if (el.textContent.includes('Wait') || el.textContent.includes('...')) {
console.log("[fastwait] found waiting button → forcing activation");
// Remove waiting classes
el.classList.remove('cursor-wait', 'bg-[#1A56DB]/70', 'select-none');
el.classList.add('cursor-pointer', 'bg-[#1A56DB]');
// Restore text
if (el.textContent.includes('Wait')) {
el.textContent = 'Open';
}
// Try to re-attach the original onclick if possible
if (!el.onclick && el.hasAttribute('data-onclick')) {
try {
el.onclick = new Function(el.getAttribute('data-onclick'));
} catch {}
}
// Force click after tiny delay
setTimeout(() => {
if (el.isConnected) {
console.log("[fastwait] auto-clicking button");
el.click();
}
}, 120);
}
});
}
// ──────────────────────────────────────────────────────────────── //
// Observer – catches button the moment it is added/changed //
// ──────────────────────────────────────────────────────────────── //
new MutationObserver((mutations) => {
let shouldCheck = false;
for (const mut of mutations) {
if (mut.type === 'childList' || mut.type === 'attributes') {
shouldCheck = true;
break;
}
}
if (shouldCheck) {
tryActivateButton();
}
}).observe(document.documentElement, {
childList: true,
subtree: true,
attributes: true,
attributeFilter: ['class', 'style', 'innerHTML', 'textContent']
});
// Initial check + periodic safety net
setInterval(tryActivateButton, 400);
// Also try very early
document.addEventListener('DOMContentLoaded', tryActivateButton, {once: true});
if (document.readyState !== 'loading') tryActivateButton();
})();