I think I've found a problem but not 100% sure. I'm trying to connect Chrome-Remote-Interface to my application but it's failing. Looking at the source for the interface, I can see this.
- Code: Select all
// Chrome-remote-interface/lib/devtools.js
// use the proper protocol fetcher
if (!browser.match(/^(Headless)?Chrome\//) &&
!browser.match(/^Microsoft Edge /) &&
!browser.match(/^node.js\//)) {
callback(new Error('Unknown implementation'));
return;
}
I think it's fetching information from "http://127.0.0.1:9222/json/version". Which has nothing filled in for my Browser field and therefore failing the match above.
{
"Browser": "",
"Protocol-Version": "1.2",
"User-Agent": "Mozilla/5.0 (Windows NT 6.2; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.75 Safari/537.36",
"V8-Version": "6.2.414.36",
"WebKit-Version": "537.36 (@a81f9fcaaff35205d07ef634bd8fc79e088c68ac)",
"webSocketDebuggerUrl": "ws://127.0.0.1:9222/devtools/browser/2aa2bfd7-b187-4bfc-8771-0526a937fd5a"
}
The error from my node then is:
Cannot connect to browser: Error: Unknown implementation
at C:\dev\misc\puppeteerExample\node_modules\chrome-remote-interface\lib\devtools.js:29:22
at C:\dev\misc\puppeteerExample\node_modules\chrome-remote-interface\lib\devtools.js:96:13
at IncomingMessage.<anonymous> (C:\dev\misc\puppeteerExample\node_modules\chrome-remote-interface\lib\external-request.js:14:17)
at emitNone (events.js:110:20)
at IncomingMessage.emit (events.js:207:7)
at endReadableNT (_stream_readable.js:1059:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
My question is, should this browser field in the json returned contain the word "Chrome" seeing as it effectively is that? Or is it possible for me to populate that field?
Thanks,
Stephen