oki now it worky

This commit is contained in:
nelle 2024-08-24 02:42:43 -06:00
parent c43c81c4fc
commit 609ab1a60d
5 changed files with 14 additions and 12 deletions

View file

@ -1,21 +1,22 @@
function onload() {
if (!localStorage.getItem('chromeAccepted')) {
if (!localStorage.getItem('disclaimerAccepted')) {
redirect()
}
else {
return
}
}
acceptDisclaimer() {
sessionStorage.removeItem( 'chromeAccepted');
function acceptDisclaimer() {
console.debug(sessionStorage.getItem('disclaimerAccepted'))
}
function redirect() {
const chromium = /Chrome|Chromium|OPR|Opera|Edge|UC|QQ|Brave/.test(
navigator.userAgent
);
const disclaimer = `<div class="web-disclaimer">`;
if (chromium && screen.width >= 699) window.location.replace("/bsod");
if (chromium && screen.width <= 699) window.location.replace("/mobile-warn");
if (chromium && screen.width >= 699) {
window.location.replace("/bsod");
}
if (chromium && screen.width <= 699) {
window.location.replace("/mobile-warn");
}
}

View file

@ -25,5 +25,6 @@ const { title } = Astro.props;
</section>
<Footer />
<NochromeScripts />
<script type="text/javascript">localStorage.setItem('disclaimerAccepted', 1);</script>
</body>
</html>

View file

@ -7,7 +7,7 @@ import Head from "../../components/fuckchrome/bsod-head.astro";
<head>
<Head />
</head>
<body onload="onload()" id="body">
<body id="body">
<slot />
</body>
</html>

View file

@ -14,7 +14,7 @@ import Layout from "../layouts/fuckchrome/bsod.astro";
</div>
<div class="error-text">
<br>
<p>For more information about this issue and possible fixes, and to never be redirected again, visit <a href="/nochrome" style="color=#ffffff;" onclick="acceptDisclaimer()">https://nelle.observer/nochrome</a></p>
<p>For more information about this issue and possible fixes, and to never be redirected again, visit <a href="/nochrome" style="color=#ffffff;">https://nelle.observer/nochrome</a></p>
<p>If you contact me about this, please give me this error:</p>
<p>Stop Code: EW_CHROME_YUCK</p>
</div>

View file

@ -8,6 +8,6 @@ import Layout from "../layouts/fuckchrome/mobile-warn.astro";
<p>The website on <span style="font-weight: bold;">nelle.observer</span> is scared of chromium-based browsers, which yours seems to be of.</p>
<p style="font-size: smaller;">NET::EW_CHROME_YUCK</p>
<br>
<a href="/nochrome" onclick="acceptDisclaimer()">Proceed to information (unsafe) and to never be redirected again</a>
<a href="/nochrome">Proceed to information (unsafe) and to never be redirected again</a>
</main>
</Layout>