background.js:
chrome.webRequest.onBeforeRequest.addListener(function (details) {
console.log(details.url);
window.location.href = 'http://time.com/';
}, {urls: ['<all_urls>']}, []);
It shows all requests in the console when I visit a web site, but it doesn't redirect the site to time.com.
Additional Information:
I got error on background console here:
Error in event handler for webRequest.onHeadersReceived/1: ReferenceError: url is not defined at chrome.webRequest.onHeadersReceived.addListener.urls (chrome-extension://hkiajgmcjicgampfdeiiacbojlmdokob/background.js:5:8)
then... is there a way to see requests with console.log from time.com in this case?
I like to see request and don't need to redirect on Chrome window. What I need is only request to see in background console.