diff options
Diffstat (limited to 'views/disable.js')
-rw-r--r-- | views/disable.js | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/views/disable.js b/views/disable.js index a34aead..f00b6ea 100644 --- a/views/disable.js +++ b/views/disable.js @@ -2,4 +2,29 @@ // This piece of javascript reminds you to disable javascript. eval("") // make librejs block this -document.body.textContent = "Please disable JavaScript to view this site." +window.onload = () => { + hide(true) + const text = document.createElement("p") + const link = document.createElement("a") + text.textContent = "A friendly reminder to disable JavaScript by default. " + link.textContent = "Continue anyway" + link.href = "#" + link.addEventListener("click", () => { + text.remove() + hide(false) + + let t = "#this-messes-with-your-history-navigation-buttons-on-purpose" + while (t.length > 0) { + window.location.href = t + t = t.split("-").slice(0, -1).join("-") + } + }) + text.append(link) + document.body.append(text) +} + +function hide(v) { + for (const e of document.body.children) { + e.hidden = v + } +} |