Skip to content

Commit

Permalink
Fix: make navigation check more strict
Browse files Browse the repository at this point in the history
This patch is there to ignore the pollution of Ids from HTMLElements in lightdom effecting the check if the polyfill should be applied

<div id="navigation"> in the DOM would make shouldApplyPolyfill return false, which is non desired behavior IMO.
  • Loading branch information
lucsoft authored Jan 27, 2025
1 parent d191402 commit bd207c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/apply-polyfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function applyPolyfill(options: NavigationPolyfillOptions = DEFAULT_POLYF
export function shouldApplyPolyfill(navigation = getNavigation()) {
return (
navigation !== globalNavigation &&
!globalNavigation &&
!Object.hasOwn(globalThis, 'navigation') &&
typeof window !== "undefined"
);
}
}

0 comments on commit bd207c5

Please sign in to comment.