Skip to content

Commit 6c6906d

Browse files
authored
Merge pull request #400 from gilest/fix/navigator-access
Avoid Fastboot crash when accessing `navigator` global
2 parents 8cfea65 + fb5b6df commit 6c6906d

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ module.exports = {
1919
env: {
2020
browser: true,
2121
},
22+
globals: {
23+
globalThis: 'readonly',
24+
},
2225
rules: {
2326
'no-setter-return': 'off',
2427
'ember/classic-decorator-no-classic-methods': 'warn',

addon/utils/config-utils.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export function getDestinationElementIdFromConfig(config) {
1111
return modalContainerId;
1212
}
1313

14-
export const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
14+
export const isIOS =
15+
(globalThis.navigator || false) &&
16+
/iPad|iPhone|iPod/.test(navigator.userAgent);
1517

1618
export function clickHandlerDelay(component) {
1719
let ENV = getOwner(component).resolveRegistration('config:environment');

0 commit comments

Comments
 (0)