-
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathads.js
24 lines (23 loc) · 862 Bytes
/
ads.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
(() => {
const urlDirectClick = "";
const urlDirectClick2 = "";
document.querySelectorAll("a").forEach(element => {
element.setAttribute("target", "_blank");
element.addEventListener("click", event => {
const isTargetBlank = event.target.target === "_blank";
const isShortcutKeyPressed = event.ctrlKey || event.shiftKey || event.metaKey;
if (isTargetBlank || isShortcutKeyPressed) {
try {
setTimeout(() => {
window.location.href = urlDirectClick2;
}, 1000);
} catch (e) {};
};
});
});
document.querySelector("body").addEventListener("click", (event) => {
setTimeout(() => {
window.location.href = urlDirectClick2;
}, 1000);
});
})();