Konrad Dzwinel
var Chrome = require('chrome-remote-interface');
Chrome(function (chrome) {
with (chrome) {
Network.enable();
Page.enable();
// log all requests before they are sent
Network.requestWillBeSent(function (params) {
console.log(params.request.url);
});
// once page loads, navigate to another page
once('ready', function () {
Page.navigate({'url': 'https://github.com'});
});
}
});
// attach debugger to a specific tab
chrome.debugger.attach({
tabId: tabId
}, '1.1', function() {
// navigate to another page
chrome.debugger.sendCommand({
tabId: tabId
}, 'Page.navigate', {
url: 'https://github.com'
});
});