chrome-remote-interface
Advanced tools
Comparing version 0.23.2 to 0.23.3
@@ -24,7 +24,19 @@ 'use strict'; | ||
const defaultTarget = function (targets) { | ||
const target = targets.find((target) => !!target.webSocketDebuggerUrl); | ||
// prefer type = 'page' inspectabe targets as they represents | ||
// browser tabs (fall back to the first instectable target | ||
// otherwise) | ||
let backup; | ||
let target = targets.find((target) => { | ||
if (target.webSocketDebuggerUrl) { | ||
backup = backup || target; | ||
return target.type === 'page'; | ||
} else { | ||
return false; | ||
} | ||
}); | ||
target = target || backup; | ||
if (target) { | ||
return target; | ||
} else { | ||
throw new Error ('No inspectable targets'); | ||
throw new Error('No inspectable targets'); | ||
} | ||
@@ -31,0 +43,0 @@ }; |
@@ -12,3 +12,3 @@ { | ||
"homepage": "https://github.com/cyrus-and/chrome-remote-interface", | ||
"version": "0.23.2", | ||
"version": "0.23.3", | ||
"repository": { | ||
@@ -15,0 +15,0 @@ "type": "git", |
@@ -75,3 +75,3 @@ chrome-remote-interface [![Build Status](https://travis-ci.org/cyrus-and/chrome-remote-interface.svg?branch=master)](https://travis-ci.org/cyrus-and/chrome-remote-interface) | ||
[1.1]: #chromechromium | ||
[1.2]: https://chromedevtools.github.io/debugger-protocol-viewer/tot/ | ||
[1.2]: https://chromedevtools.github.io/devtools-protocol/tot/ | ||
@@ -82,3 +82,3 @@ [2.1]: #edge | ||
[3.1]: #nodejs | ||
[3.2]: https://chromedevtools.github.io/debugger-protocol-viewer/v8/ | ||
[3.2]: https://chromedevtools.github.io/devtools-protocol/v8/ | ||
@@ -85,0 +85,0 @@ [4.1]: #safari-ios |
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
968258
15513