|
8 | 8 | if (!store.get("ab")) store.set("ab", true); |
9 | 9 | if (!inFrame && !navigator.userAgent.includes("Firefox") && store.get("ab") === "true") { |
10 | 10 | const popup = open("about:blank", "_blank"); |
11 | | - setTimeout(() => { |
12 | | - if (!popup || popup.closed) { |
13 | | - } else { |
14 | | - const doc = popup.document; |
15 | | - const iframe = doc.createElement("iframe"); |
16 | | - const style = iframe.style; |
17 | | - const link = doc.createElement("link"); |
| 11 | + if (popup && !popup.closed) { |
| 12 | + const doc = popup.document; |
| 13 | + const iframe = doc.createElement("iframe"); |
| 14 | + const style = iframe.style; |
| 15 | + const link = doc.createElement("link"); |
| 16 | + const script = doc.createElement("script"); |
18 | 17 |
|
19 | | - const name = store.get("name") || "My Drive - Google Drive"; |
20 | | - const icon = store.get("icon") || "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"; |
| 18 | + const name = store.get("name") || "My Drive - Google Drive"; |
| 19 | + const icon = store.get("icon") || "https://ssl.gstatic.com/docs/doclist/images/drive_2022q3_32dp.png"; |
21 | 20 |
|
22 | | - doc.title = name; |
23 | | - link.rel = "icon"; |
24 | | - link.href = icon; |
| 21 | + doc.title = (window.laceTitle || (s => s))(name); |
| 22 | + link.rel = "icon"; |
| 23 | + link.href = icon; |
25 | 24 |
|
26 | | - iframe.src = location.href; |
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%"; |
| 25 | + iframe.src = location.href; |
| 26 | + style.position = "fixed"; |
| 27 | + style.top = style.bottom = style.left = style.right = 0; |
| 28 | + style.border = style.outline = "none"; |
| 29 | + style.width = style.height = "100%"; |
31 | 30 |
|
32 | | - doc.head.appendChild(link); |
33 | | - doc.body.appendChild(iframe); |
34 | | - |
35 | | - const pLink = store.get("pLink") || getRandomUrl(); |
36 | | - location.replace(pLink); |
37 | | - |
38 | | - const script = doc.createElement("script"); |
39 | | - script.textContent = ` |
| 31 | + script.textContent = ` |
40 | 32 | window.onbeforeunload = function (event) { |
41 | 33 | const confirmationMessage = 'Leave Site?'; |
42 | 34 | (event || window.event).returnValue = confirmationMessage; |
43 | 35 | return confirmationMessage; |
44 | 36 | }; |
45 | 37 | `; |
46 | | - doc.head.appendChild(script); |
47 | | - } |
48 | | - }, 2000); |
| 38 | + |
| 39 | + doc.head.appendChild(link); |
| 40 | + doc.head.appendChild(script); |
| 41 | + doc.body.appendChild(iframe); |
| 42 | + |
| 43 | + const pLink = store.get("pLink") || getRandomUrl(); |
| 44 | + location.replace(pLink); |
| 45 | + } |
49 | 46 | } |
50 | 47 |
|
51 | 48 | const SplashT = [ |
|
0 commit comments