chrome-launcher
chrome-launcher copied to clipboard
is it possible to launch a dev-tools url?
I'm trying to launch chrome with a dev-tools socket url, but it doesn't work, if I manually enter the URL in then it does, I assume this has to do with the custom dev-tools protocol?
Do you have any suggestions on how to programmatically open a dev-tools URL, for example: chrome-devtools://devtools/bundled/inspector.html?experiments=true&v8only=true&ws=0.0.0.0:9222/e954b542-f175-4639-bcc9-2ec64f477123
.
I have the same problems. Anyone have any suggestion about this?
Any update?
The straightforward ways of doing this don't work, due to security concerns.
I believe the only way is using the protocol itself (Page.navigate
)
Got it, it's on this url http://localhost:9222/json/version so you can curl or create a request.
'use strict';
const chromeLauncher = require('chrome-launcher');
const fetch = require('node-fetch');
(async () => {
const chrome = await chromeLauncher.launch({
headless: true,
port: 9222
});
const request = await fetch('http://localhost:9222/json/version');
const webSocketDebuggerUrl = (await request.json()).webSocketDebuggerUrl;
console.log(webSocketDebuggerUrl);
// do stuff
})();