-
-
Save omisolaidowu/0f4e002902d98c8908575828bc945946 to your computer and use it in GitHub Desktop.
Patching
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
// ... | |
// patch the navigator.deviceMemory and navigator.hardwareConcurrency properties | |
await page.evaluateOnNewDocument(() => { | |
// redefine navigator.deviceMemory to return a custom value (16GB RAM) | |
Object.defineProperty(navigator, 'deviceMemory', { | |
value: 16 | |
}); | |
// redefine navigatorhardwareConcurrency to return a custom value (8 CPU cores) | |
Object.defineProperty(navigator, 'hardwareConcurrency', { | |
value: 8 | |
}); | |
}); | |
await browser.close(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment