notes/Use Chrome Headless to list all URL request of page-M3Ke7RYB.sh
#list all url requests in chrome browser using Chrome Headless
#start chrome headless
google-chrome --headless --remote-debugging-port=9222
#run the script below with nodejs
nodejs script.js
#now open chrome and navigate to page
#click on about:blank then type address
google-chrome "http://localhost:9222
//STart script//
var Chrome = require('chrome-remote-interface');
Chrome(function (chrome) {
with (chrome) {
Network.requestWillBeSent(function (params) {
console.log(params.request.url);
});
//Page.loadEventFired(close);
Network.enable();
Page.enable();
/* once('ready', function () {
Page.navigate({'url': 'https://filmsbykris.com'});
});
*/
}
}).on('error', function (err) {
console.error('Cannot connect to Chrome:', err);
});