Specific message for Apple mobile devices (iPhone, iPad)
All checks were successful
Build and test project / build-and-test (push) Successful in 1m35s
All checks were successful
Build and test project / build-and-test (push) Successful in 1m35s
These devices will never support the FS API, not even via alternative browsers because Apple enforces WebKit on all these browsers.
This commit is contained in:
@@ -34,9 +34,9 @@
|
||||
<script src="js/jszip.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<main>
|
||||
<header class="hero">
|
||||
<h1>KoboPatch <span class="hero-accent">Web UI</span> <span class="beta-pill">beta</span></h1>
|
||||
<h1>KoboPatch <span class="hero-accent">Web UI</span> <span class="beta-pill" hidden>beta</span></h1>
|
||||
<p class="subtitle">Customise your Kobo e-reader with NickelMenu or custom patches.</p>
|
||||
</header>
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<p id="connect-unsupported-hint" class="fallback-hint" hidden>
|
||||
<b>Note:</b> Your browser does not support direct device access via the <a href="https://caniuse.com/native-filesystem-api">native filesystem API</a>, which is required for a seamless patching experience. Directly connecting to your Kobo is not available because of this. Use Chrome, Edge or Opera to connect your Kobo directly, or choose the manual download option.
|
||||
<b>Note:</b> <span id="connect-unsupported-text">Your browser does not support direct device access via the <a href="https://caniuse.com/native-filesystem-api">native filesystem API</a>, which is required for a seamless patching experience. Directly connecting to your Kobo is not available because of this. Use Chrome, Edge or Opera to connect your Kobo directly, or choose the manual download option.</span>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -212,11 +212,22 @@ state.goToModeSelection = goToModeSelection;
|
||||
const loader = $('initial-loader');
|
||||
if (loader) loader.remove();
|
||||
|
||||
// Detect iOS (Safari/WebKit) — the File System Access API is unavailable on iOS.
|
||||
const isAppleMobileDevice = /iPad|iPhone|iPod/.test(navigator.userAgent) ||
|
||||
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
||||
|
||||
// Disable the "Connect" button if the File System Access API isn't available.
|
||||
const hasFileSystemAccess = KoboDevice.isSupported();
|
||||
if (!hasFileSystemAccess) {
|
||||
btnConnect.disabled = true;
|
||||
$('connect-unsupported-hint').hidden = false;
|
||||
if (isAppleMobileDevice) {
|
||||
$('connect-unsupported-text').innerHTML =
|
||||
'Directly connecting your Kobo is not available on iOS because Safari does not support the ' +
|
||||
'<a href="https://caniuse.com/native-filesystem-api">native filesystem API</a>. ' +
|
||||
'For the best experience, use <b>Chrome, Edge, or Opera</b> on a desktop or laptop computer. ' +
|
||||
'You can still use the <b>manual download</b> option below.';
|
||||
}
|
||||
}
|
||||
|
||||
setNavLabels(TL.NAV_DEFAULT);
|
||||
|
||||
Reference in New Issue
Block a user