Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
OutRed
GitHub Repository: OutRed/artclass
Path: blob/main/static/js/cloak.js
595 views
1
function blank() {
2
const url = location.href;
3
const width = window.innerWidth;
4
const height = window.innerHeight;
5
6
let inFrame;
7
8
try {
9
inFrame = window !== top;
10
} catch (e) {
11
inFrame = true;
12
}
13
14
if (!inFrame && !navigator.userAgent.includes("Firefox")) {
15
const popup = window.open("about:blank", name, `width=${width},height=${height}`);
16
17
if (!popup || popup.closed) {
18
alert("Allow popups and redirects to hide this from showing up in your history.");
19
} else {
20
const doc = popup.document;
21
const iframe = doc.createElement("iframe");
22
const style = iframe.style;
23
const link = doc.createElement("link");
24
25
26
iframe.src = url;
27
style.position = "fixed";
28
style.top = style.bottom = style.left = style.right = 0;
29
style.border = style.outline = "none";
30
style.width = style.height = "100%";
31
32
doc.head.appendChild(link);
33
doc.body.appendChild(iframe);
34
window.location.replace("https://google.com");
35
}
36
}
37
}
38
39