chrome-remote-interface
Advanced tools
Comparing version 0.25.1 to 0.25.2
@@ -5,2 +5,3 @@ 'use strict'; | ||
const util = require('util'); | ||
const parseUrl = require('url').parse; | ||
@@ -141,11 +142,14 @@ const WebSocket = require('ws'); | ||
const options = {'host': chrome.host, 'port': chrome.port, 'secure': chrome.secure}; | ||
Promise.all([ | ||
// fetch the WebSocket debugger URL | ||
fetchDebuggerURL.call(chrome, options).then(function (url) { | ||
chrome.webSocketUrl = url; | ||
// update the connection parameters using the debugging URL | ||
const urlObject = parseUrl(url); | ||
options.host = urlObject.hostname; | ||
options.port = urlObject.port; | ||
// fetch the protocol and prepare the API | ||
fetchProtocol.call(chrome, options).then(api.prepare.bind(chrome)), | ||
// in the meanwhile fetch the WebSocket debugger URL | ||
fetchDebuggerURL.call(chrome, options) | ||
]).then(function (values) { | ||
return fetchProtocol.call(chrome, options).then(api.prepare.bind(chrome)); | ||
}).then(function (values) { | ||
// finally connect to the WebSocket | ||
const url = values[1]; | ||
return connectToWebSocket.call(chrome, url); | ||
return connectToWebSocket.call(chrome, chrome.webSocketUrl); | ||
}).then(function () { | ||
@@ -255,3 +259,2 @@ // since the handler is executed synchronously, the emit() must be | ||
} | ||
chrome.webSocketUrl = url; | ||
chrome._ws = new WebSocket(url); | ||
@@ -258,0 +261,0 @@ } catch (err) { |
@@ -12,3 +12,3 @@ { | ||
"homepage": "https://github.com/cyrus-and/chrome-remote-interface", | ||
"version": "0.25.1", | ||
"version": "0.25.2", | ||
"repository": { | ||
@@ -15,0 +15,0 @@ "type": "git", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1047301
16737