-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathmain.js
37 lines (31 loc) · 1.18 KB
/
main.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
let inFrame
try {
inFrame = window !== top
} catch (e) {
inFrame = true
}
// Cloaking Code
if (!inFrame && !navigator.userAgent.includes("Firefox")) {
const popup = open("about:blank", "_blank")
if (!popup || popup.closed) {
alert("Allow popups and redirects to hide this from showing up in your history.")
} else {
const doc = popup.document
const iframe = doc.createElement("iframe")
const style = iframe.style
const link = doc.createElement("link")
const name = localStorage.getItem("name") || "My Drive - Google Drive";
const icon = localStorage.getItem("icon") || "https://ssl.gstatic.com/images/branding/product/1x/drive_2020q4_32dp.png";
doc.title = name;
link.rel = "icon";
link.href = icon;
iframe.src = location.href
style.position = "fixed"
style.top = style.bottom = style.left = style.right = 0
style.border = style.outline = "none"
style.width = style.height = "100%"
doc.head.appendChild(link);
doc.body.appendChild(iframe)
location.replace("https://google.com")
}
}