mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-02 02:42:41 +02:00
feat: React 18 + automatic JSX runtime + build --dev (#8961)
This commit is contained in:
parent
76f920359b
commit
187e5aa218
69 changed files with 404 additions and 209 deletions
|
@ -72,8 +72,14 @@ async function getIsAppInstalledRelatedApps() {
|
|||
if (!('getInstalledRelatedApps' in window.navigator)) {
|
||||
return false;
|
||||
}
|
||||
const relatedApps = await navigator.getInstalledRelatedApps();
|
||||
return relatedApps.some((app) => app.platform === 'webapp');
|
||||
try {
|
||||
const relatedApps = await navigator.getInstalledRelatedApps();
|
||||
return relatedApps.some((app) => app.platform === 'webapp');
|
||||
} catch (e) {
|
||||
// Error might be thrown when Docusaurus is embedded in an iframe:
|
||||
// registerSW failed DOMException: Failed to execute 'getInstalledRelatedApps' on 'Navigator': getInstalledRelatedApps() is only supported in top-level browsing contexts.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function isStandaloneDisplayMode() {
|
||||
return window.matchMedia('(display-mode: standalone)').matches;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue