Hide companion features on mobile
This commit is contained in:
@@ -186,7 +186,19 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isMobileDevice() {
|
||||||
|
// The companion only ships for Windows and Linux desktops, so skip it
|
||||||
|
// on phones/tablets. Checks the UA and falls back to "touch is the only
|
||||||
|
// pointer" so narrow desktop windows still get the companion.
|
||||||
|
if (/Android|iPhone|iPad|iPod|Mobi/i.test(navigator.userAgent)) return true;
|
||||||
|
return window.matchMedia('(pointer: coarse)').matches &&
|
||||||
|
!window.matchMedia('(any-pointer: fine)').matches;
|
||||||
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
// Every companion element is rendered hidden, so bailing out here
|
||||||
|
// leaves the status icon and reveal buttons invisible on mobile.
|
||||||
|
if (isMobileDevice()) return;
|
||||||
probeStatus().then(function () {
|
probeStatus().then(function () {
|
||||||
updateFooterIcon();
|
updateFooterIcon();
|
||||||
wireFileLinks();
|
wireFileLinks();
|
||||||
|
|||||||
Reference in New Issue
Block a user