Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connect: function(options, cb) {
var self = this;
self.options = options;
var client = chrome.createClient();
client.on("error", function(error) {
console.log(error);
});
self.client = client;
if (options.websocket) {
return cb(null, {
url: '',
webSocketDebuggerUrl: options.websocket
});
} else {
client.listTabs(options.host, options.port, function(err, tabs) {
if(err) return cb(err);
// TODO: skip tabs without webSocketDebuggerUrl (likely already being debugged)
cb(null, tabs[0]);
});
}