// ==UserScript==
// @name Time Hooker (V6.3 - Time Spoofer & Anti-Tab Pause)
// @namespace https://tampermonkey.net/
// @version 6.3
// @description Hook wait timers, spoof real-time clock, bypass adblock, and stop tab-pause
// @author Pankaj034
// @match *://*/*
// @grant none
// @run-at document-start
// @downloadURL https://update.greasyfork.icu/scripts/569833/Time%20Hooker%20%28V63%20-%20Time%20Spoofer%20%20Anti-Tab%20Pause%29.user.js
// @updateURL https://update.greasyfork.icu/scripts/569833/Time%20Hooker%20%28V63%20-%20Time%20Spoofer%20%20Anti-Tab%20Pause%29.meta.js
// ==/UserScript==
(function () {
'use strict';
const STORAGE_KEY = "time_hooker_ui_settings_v12";
const DEFAULTS = {
autoClick: false,
highlight: true,
pinMode: true,
antiAdblock: true,
skipTimers: true,
topOffset: 150
};
function loadSettings() {
try { return Object.assign({}, DEFAULTS, JSON.parse(localStorage.getItem(STORAGE_KEY)) || {}); }
catch (e) { return Object.assign({}, DEFAULTS); }
}
function saveSettings(s) {
localStorage.setItem(STORAGE_KEY, JSON.stringify(s));
}
let S = loadSettings();
// ---------- CLOUDFLARE DETECTION ----------
const cloudflareIndicators = [
"Checking your browser",
"verify your browser",
"cloudflare",
"turnstile",
"please wait while we verify"
];
function isCloudflarePresent() {
return Array.from(document.querySelectorAll('*')).some(el => {
if (!el || !el.textContent) return false;
const text = el.textContent.toLowerCase();
const idOrClass = ((el.id || "") + " " + (el.className || "")).toLowerCase();
if (text.length > 500) return false;
return cloudflareIndicators.some(indicator =>
text.includes(indicator) || idOrClass.includes(indicator)
);
});
}
// ---------- TIMER & CLOCK HIJACKING ENGINE (NEW) ----------
const originalSetInterval = window.setInterval;
const originalSetTimeout = window.setTimeout;
const originalDateNow = Date.now;
const originalPerfNow = performance.now.bind(performance);
const SPEED_MULTIPLIER = 15;
let isTimerHooked = false;
// Fake Clock variables
let timeAppDate = originalDateNow();
let timeAppPerf = originalPerfNow();
let lastTickDate = originalDateNow();
let lastTickPerf = originalPerfNow();
function hookTimers() {
if (isTimerHooked) return;
// 1. Hook Timeout & Interval
window.setTimeout = function(callback, delay, ...args) {
const newDelay = (S.skipTimers && !isCloudflarePresent()) ? (delay / SPEED_MULTIPLIER) : delay;
return originalSetTimeout(callback, newDelay, ...args);
};
window.setInterval = function(callback, interval, ...args) {
const newInterval = (S.skipTimers && !isCloudflarePresent()) ? (interval / SPEED_MULTIPLIER) : interval;
return originalSetInterval(callback, newInterval, ...args);
};
// 2. Hook Real-Time Clock (Spoofer)
Date.now = function() {
let now = originalDateNow();
let delta = now - lastTickDate;
lastTickDate = now;
let multiplier = (S.skipTimers && !isCloudflarePresent()) ? SPEED_MULTIPLIER : 1;
timeAppDate += (delta * multiplier);
return Math.floor(timeAppDate);
};
window.performance.now = function() {
let now = originalPerfNow();
let delta = now - lastTickPerf;
lastTickPerf = now;
let multiplier = (S.skipTimers && !isCloudflarePresent()) ? SPEED_MULTIPLIER : 1;
timeAppPerf += (delta * multiplier);
return timeAppPerf;
};
isTimerHooked = true;
console.log("⚡ [Time Hooker] Timers & Clock Hooked! Speed:", SPEED_MULTIPLIER);
}
function unhookTimers() {
if (!isTimerHooked) return;
window.setInterval = originalSetInterval;
window.setTimeout = originalSetTimeout;
Date.now = originalDateNow;
window.performance.now = originalPerfNow;
isTimerHooked = false;
console.log("🛑 [Time Hooker] Timers Unhooked (Normal Speed).");
}
if (S.skipTimers) hookTimers();
// ---------- ANTI-TAB PAUSE (VISIBILITY SPOOFER) ----------
// Website ko hamesha lagega ki tum page ko hi dekh rahe ho
Object.defineProperty(document, 'hidden', { get: () => false });
Object.defineProperty(document, 'visibilityState', { get: () => 'visible' });
const blockVisibilityEvent = (e) => {
e.stopImmediatePropagation();
e.preventDefault();
};
window.addEventListener('visibilitychange', blockVisibilityEvent, true);
document.addEventListener('visibilitychange', blockVisibilityEvent, true);
window.addEventListener('blur', blockVisibilityEvent, true);
document.addEventListener('blur', blockVisibilityEvent, true);
// ---------- UI PANEL ----------
function createPanel() {
if (!document.body || !document.documentElement) {
originalSetTimeout(createPanel, 100);
return;
}
if (document.getElementById("th-panel")) return;
const panel = document.createElement("div");
panel.id = "th-panel";
panel.style.cssText = "position: fixed; top: 14px; right: 14px; width: 230px; z-index: 2147483647; background: rgba(0,0,0,0.85); color: #ffffff !important; font-family: Arial, sans-serif; font-size: 13px; border-radius: 10px; padding: 10px 10px 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); backdrop-filter: blur(6px); user-select: none;";
panel.setAttribute("data-hidden", "1");
panel.innerHTML = [
'
',
'',
'',
'',
'',
'',
'',
'
',
'Position',
'' + S.topOffset + 'px',
'
',
'
',
'
'
].join('');
document.documentElement.appendChild(panel);
const $ = (id) => document.getElementById(id);
$("th-skiptimers").checked = S.skipTimers;
$("th-autoclick").checked = S.autoClick;
$("th-highlight").checked = S.highlight;
$("th-pin").checked = S.pinMode;
$("th-antiad").checked = S.antiAdblock;
function bindToggle(id, key) {
$(id).addEventListener("change", () => {
S[key] = $(id).checked;
saveSettings(S);
if (key === 'skipTimers') {
if (S.skipTimers) hookTimers();
else unhookTimers();
}
applyNow();
});
}
bindToggle("th-skiptimers", "skipTimers");
bindToggle("th-autoclick", "autoClick");
bindToggle("th-highlight", "highlight");
bindToggle("th-pin", "pinMode");
bindToggle("th-antiad", "antiAdblock");
$("th-pos").addEventListener("input", () => {
S.topOffset = parseInt($("th-pos").value, 10) || 0;
$("th-pos-val").textContent = S.topOffset + "px";
saveSettings(S);
applyNow();
});
$("th-hide").addEventListener("click", () => {
const bodyNodes = Array.from(panel.querySelectorAll(".th-togglable"));
const hidden = panel.getAttribute("data-hidden") === "1";
panel.setAttribute("data-hidden", hidden ? "0" : "1");
bodyNodes.forEach(n => { n.style.display = hidden ? (n.tagName === "LABEL" ? "flex" : "block") : "none"; });
$("th-hide").textContent = hidden ? "—" : "+";
});
let drag = false, sx = 0, sy = 0;
$("th-header").addEventListener("mousedown", (e) => {
if (e.target.tagName === "BUTTON") return;
drag = true;
const rect = panel.getBoundingClientRect();
sx = e.clientX - rect.left; sy = e.clientY - rect.top;
});
window.addEventListener("mousemove", (e) => {
if (!drag) return;
panel.style.right = 'auto'; panel.style.left = (e.clientX - sx) + "px"; panel.style.top = (e.clientY - sy) + "px";
});
window.addEventListener("mouseup", () => drag = false);
}
// ---------- AGGRESSIVE ANTI-ADBLOCK NUKER ----------
function nukeAdblockers() {
if (!S.antiAdblock || !document.body) return;
document.body.style.setProperty("overflow", "auto", "important");
document.body.style.setProperty("filter", "none", "important");
document.documentElement.style.setProperty("overflow", "auto", "important");
const badWords = ["adblocker detected", "disable your ad", "ad blocker", "brave browser is not supported"];
const allDivs = document.querySelectorAll("div, section, aside");
allDivs.forEach(el => {
if (el.id === "th-panel" || el.id === "th-proxy-btn") return;
const cs = window.getComputedStyle(el);
const z = parseInt(cs.zIndex, 10);
const isOverlay = cs.position === "fixed" || cs.position === "absolute" || (!isNaN(z) && z > 50);
if (isOverlay) {
const text = el.innerText ? el.innerText.toLowerCase() : "";
if (text && badWords.some(w => text.includes(w))) {
el.remove();
}
}
});
}
// ---------- FORCE ENABLE DISABLED BUTTONS ----------
// Agar timer 0 hone se pehle hi button disabled hai, toh usko forcefully on kar do
function forceEnableWaitButtons() {
document.querySelectorAll("button:disabled, a.disabled, [disabled]").forEach(el => {
const t = (el.innerText || "").toLowerCase();
if (t.includes("wait") || t.includes("second") || t.includes("continue")) {
el.disabled = false;
el.removeAttribute("disabled");
el.style.pointerEvents = "auto";
el.style.opacity = "1";
}
});
}
// ---------- TARGET FINDER ----------
const KEYWORDS = ["continue", "get link", "proceed", "verify", "download", "next step", "please wait"];
function getCandidates() {
if(!document.body) return [];
const nodes = document.querySelectorAll("a, button, input[type='button'], input[type='submit'], [role='button'], [role='link']");
return Array.from(nodes).filter(el => {
// Humne yahan "disabled" check hata diya hai kyunki forceEnable usko theek kar dega
if (el.offsetWidth === 0 || el.offsetHeight === 0) return false;
if (el.id === "th-proxy-btn" || el.id === "th-hide") return false;
const t = (el.innerText || el.value || el.textContent || "").toLowerCase().trim();
if (!t) return false;
return KEYWORDS.some(k => t.includes(k));
});
}
// ---------- SMART PROXY LOGIC ----------
function handlePinMode(bestEl) {
if(!document.body) return;
let proxyBtn = document.getElementById("th-proxy-btn");
if (S.pinMode && bestEl) {
if (!proxyBtn) {
proxyBtn = document.createElement("button");
proxyBtn.id = "th-proxy-btn";
proxyBtn.style.cssText = "position: fixed !important; left: 50% !important; transform: translateX(-50%) !important; z-index: 2147483647 !important; padding: 15px 30px !important; font-size: 18px !important; font-weight: bold !important; background: linear-gradient(90deg, #ff0055, #ffaa00) !important; color: #ffffff !important; border: 3px solid white !important; border-radius: 10px !important; cursor: pointer !important; box-shadow: 0 5px 15px rgba(0,0,0,0.5) !important;";
document.body.appendChild(proxyBtn);
}
let btnText = (bestEl.innerText || bestEl.value || "CONTINUE").trim().substring(0, 15);
proxyBtn.innerText = "🚀 CLICK TO " + btnText.replace("Please wait", "SKIP");
proxyBtn.style.setProperty('top', S.topOffset + 'px', 'important');
proxyBtn.style.display = "block";
proxyBtn.onclick = (e) => {
e.preventDefault();
proxyBtn.innerText = "⏳ WAITING...";
proxyBtn.style.background = "#555 !important";
bestEl.click();
};
} else if (proxyBtn) {
proxyBtn.style.display = "none";
}
}
function highlight(el) {
if (!el) return;
if (!S.highlight) {
el.style.outline = ""; el.style.boxShadow = ""; return;
}
el.style.setProperty('outline', '4px solid rgba(0, 255, 85, 0.9)', 'important');
el.style.setProperty('box-shadow', '0 0 15px rgba(0,255,85,0.6)', 'important');
}
function tryAutoClick(el) {
if (!el || !S.autoClick) return;
if (el.dataset.thClicked === "1") return;
// Disable auto click for "Please wait" state to avoid false triggers
const t = (el.innerText || "").toLowerCase();
if (t.includes("wait") || t.includes("second")) return;
el.dataset.thClicked = "1";
originalSetTimeout(() => {
if (!document.contains(el)) return;
try { el.click(); } catch (e) {}
}, 1000);
}
function applyNow() {
nukeAdblockers();
forceEnableWaitButtons(); // Naya force unlocker
const candidates = getCandidates();
let proxyBtn = document.getElementById("th-proxy-btn");
if (!candidates.length) {
if (proxyBtn) proxyBtn.style.display = "none";
return;
}
const best = candidates.sort((a, b) => {
const aArea = a.getBoundingClientRect().width * a.getBoundingClientRect().height;
const bArea = b.getBoundingClientRect().width * b.getBoundingClientRect().height;
return bArea - aArea;
})[0];
handlePinMode(best);
highlight(best);
tryAutoClick(best);
}
// ---------- START ----------
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", () => {
createPanel();
applyNow();
});
} else {
createPanel();
applyNow();
}
let debounceTimer;
const observer = new MutationObserver(() => {
clearTimeout(debounceTimer);
debounceTimer = originalSetTimeout(applyNow, 200);
});
const startObserver = () => {
if (document.documentElement) {
observer.observe(document.documentElement, { childList: true, subtree: true });
} else {
originalSetTimeout(startObserver, 100);
}
};
startObserver();
originalSetInterval(applyNow, 1000);
})();
// ==UserScript==
// @name New script
// @namespace Violentmonkey Scripts
// @match *://example.org/*
// @icon
// @grant none
// @version 1.0
// @author -
// @description 05/03/2026, 03:21:49
// ==/UserScript==