Automatically set PC Mode if unset (#2861)

* Automatically set PC Mode if unset

based on the UserAgent

* slight reduction

Reduce flash usage a bit.

Co-authored-by: Blaž Kristan <blaz@kristan-sp.si>
This commit is contained in:
Benjamin G 2022-11-03 17:01:32 -05:00 committed by GitHub
parent 81d2a67948
commit 0cfda55b3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -262,7 +262,7 @@ function onLoad()
d.addEventListener("visibilitychange", handleVisibilityChange, false);
size();
gId("cv").style.opacity=0;
if (localStorage.getItem('pcm') == "true") togglePcMode(true);
if (localStorage.getItem('pcm') == "true" || (!/Mobi/.test(navigator.userAgent) && localStorage.getItem('pcm') == null)) togglePcMode(true);
var sls = d.querySelectorAll('input[type="range"]');
for (var sl of sls) {
sl.addEventListener('touchstart', toggleBubble);