Skip to content

Instantly share code, notes, and snippets.

@evanscottgray
Created April 21, 2015 03:17
Show Gist options
  • Select an option

  • Save evanscottgray/3d8ee5d4e461760192f0 to your computer and use it in GitHub Desktop.

Select an option

Save evanscottgray/3d8ee5d4e461760192f0 to your computer and use it in GitHub Desktop.
var Chrome = require('chrome-remote-interface');
Chrome(function (chrome) {
with
(chrome) {
var url = 'http://example.com';
var params = {
'expression': 'for (var i = 0; i < 10; i++)' +
'window.open("' + url + '", "_blank");'
};
Runtime.evaluate(params, function (error, response) {
console.log(response);
close();
});
}
}).on('error', function () {
console.error('Cannot connect to Chrome');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment