Created
September 30, 2017 00:01
-
-
Save cspotcode/eb2cb1cceec7f1f8e880282b37cb2a81 to your computer and use it in GitHub Desktop.
Open a page in headless Chrome; open DevTools in another window
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
$headlessDataDir = "$( (Get-Location).Path )/headlessDataDir" | |
$devtoolsDataDir = "$( (Get-Location).Path )/devtoolsDataDir" | |
$remoteDebuggingPort = 9222 | |
$urlToInspect = https://www.example.com | |
# Open headless browser | |
& 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' "--user-data-dir=$headlessDataDir" --headless --remote-debugging-port=$remoteDebuggingPort $urlToInspect | |
# Open DevTools | |
& 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe' "--user-data-dir=$devtoolsDataDir" "http://localhost:$remoteDebuggingPort" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment