Skip to content

Commit

Permalink
detect hardwareConcurrency mismatch in iframe #16
Browse files Browse the repository at this point in the history
  • Loading branch information
abrahamjuliot committed Nov 1, 2020
1 parent 288b1be commit 8facdc3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const getNavigator = (imports, workerScope) => {
trustInteger,
documentLie,
lieProps,
contentWindow
contentWindow,
hyperNestedIframeWindow
}
} = imports

Expand Down Expand Up @@ -147,7 +148,11 @@ export const getNavigator = (imports, workerScope) => {
if (!('hardwareConcurrency' in navigator)) {
return undefined
}
const { hardwareConcurrency } = contentWindowNavigator
const hardwareConcurrency = (
hyperNestedIframeWindow ?
hyperNestedIframeWindow.navigator.hardwareConcurrency :
contentWindowNavigator.hardwareConcurrency
)
const navigatorHardwareConcurrency = navigator.hardwareConcurrency
detectLies('hardwareConcurrency', navigatorHardwareConcurrency)
trustInteger('hardwareConcurrency - invalid return type', navigatorHardwareConcurrency)
Expand Down

0 comments on commit 8facdc3

Please sign in to comment.