Created
April 21, 2015 03:17
-
-
Save evanscottgray/3d8ee5d4e461760192f0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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