chrome-remote-interface
Advanced tools
Comparing version 0.10.0 to 0.11.0
@@ -288,3 +288,8 @@ var defaults = require('./defaults.js'); | ||
var tabError; | ||
var tab = tabs[self.chooseTab(tabs)]; | ||
var tab; | ||
if (typeof self.chooseTab === 'object') { | ||
tab = self.chooseTab; | ||
} else { | ||
tab = tabs[self.chooseTab(tabs)]; | ||
} | ||
if (tab) { | ||
@@ -291,0 +296,0 @@ var tabDebuggerUrl = tab.webSocketDebuggerUrl; |
@@ -12,3 +12,3 @@ { | ||
"homepage": "https://github.com/cyrus-and/chrome-remote-interface", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"repository": { | ||
@@ -15,0 +15,0 @@ "type": "git", |
@@ -128,6 +128,7 @@ chrome-remote-interface | ||
- `port`: [Remote Debugging Protocol][rdb] port. Defaults to `9222`; | ||
- `chooseTab`: callback used to determine which remote tab attach to. Takes the | ||
array returned by `http://host:port/json` containing the tab list and must | ||
return the numeric index of a tab. Defaults to a function which returns the | ||
currently active tab (`function (tabs) { return 0; }`). | ||
- `chooseTab`: Either a callback or a tab object (i.e. those returned by `New` | ||
and `List` methods). The callback is used to determine which remote tab attach | ||
to, it takes the array returned by the `List` method and must return the | ||
numeric index of a tab. Defaults to a function which returns the currently | ||
active tab (`function (tabs) { return 0; }`). | ||
- `protocol`: [Remote Debugging Protocol][rdb] descriptor object. Passing `null` | ||
@@ -268,3 +269,3 @@ causes the proper protocol descriptor to be fetched from the remote Chrome | ||
var Chrome = require('chrome-remote-interface'); | ||
Chrome.Activate({'id': 'CC46FBFA-3BDA-493B-B2E4-2BE6EB0D97EC'}, function (err, tab) { | ||
Chrome.Activate({'id': 'CC46FBFA-3BDA-493B-B2E4-2BE6EB0D97EC'}, function (err) { | ||
if (!err) { | ||
@@ -295,3 +296,3 @@ console.log('success! tab is closing'); | ||
var Chrome = require('chrome-remote-interface'); | ||
Chrome.Close({'id': 'CC46FBFA-3BDA-493B-B2E4-2BE6EB0D97EC'}, function (err, tab) { | ||
Chrome.Close({'id': 'CC46FBFA-3BDA-493B-B2E4-2BE6EB0D97EC'}, function (err) { | ||
if (!err) { | ||
@@ -298,0 +299,0 @@ console.log('success! tab is closing'); |
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
351101
6028
482