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() {
|
||||
// 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 () {
|
||||
updateFooterIcon();
|
||||
wireFileLinks();
|
||||
|
||||
Reference in New Issue
Block a user