showing requested styles and client version on no css warning

This commit is contained in:
Miodec 2022-04-26 15:03:09 +02:00
parent 96f64039e7
commit 374251bc39
2 changed files with 22 additions and 7 deletions

View file

@ -9,6 +9,7 @@ import * as NewVersionNotification from "./elements/version-check";
import * as Notifications from "./elements/notifications";
import * as Focus from "./test/focus";
import * as CookiePopup from "./popups/cookie-popup";
import { CLIENT_VERSION } from "./version";
ManualRestart.set();
UpdateConfig.loadFromLocalStorage();
@ -22,6 +23,20 @@ if (window.location.hostname === "localhost") {
});
}
$("#nocss .requestedStylesheets").html(
"Requested stylesheets:<br>" +
(
[
...document.querySelectorAll("link[rel=stylesheet"),
] as HTMLAnchorElement[]
)
.map((l) => l.href)
.filter((l) => /\/css\//gi.test(l))
.join("<br>") +
"<br><br>Client version:<br>" +
CLIENT_VERSION
);
Focus.set(true, true);
RouteController.handleInitialPageClasses(window.location.pathname);
$(document).ready(() => {

View file

@ -66,16 +66,16 @@
>
<span style="font-size: 6rem; color: #e2b714">:(</span>
<span style="font-size: 2rem; color: #d1d0c5">
It seems like the CSS failed to load. Please clear your cache to
redownload the styles. If that doesn't help contact support.
It seems like the CSS failed to load. Please try refreshing or clearing
your cache to redownload the styles. If that doesn't help contact support.
<br />
(jack@monkeytype.com or discord.gg/monkeytype)
</span>
<span>(ctrl/cmd + shift + r on Chromium browsers)</span>
<!-- <span>
If the website works for a bit but then this screen comes back, clear
your cache again and then on Monkeytype open the command line (esc)
and search for "Clear SW cache".
</span> -->
<span class="requestedStylesheets">
If the website works for a bit but then this screen comes back, clear your
cache again and then on Monkeytype open the command line (esc) and search
for "Clear SW cache".
</span>
</div>
</div>