javascript - chrome extension that will monitor network activity on page start up using chrome.debugger -
i want information on specific requests made on pages(meaning run in background , collect information, , show on popup upon request.
when tried this, goes infinite loop, seems keep attaching debugger again , again, after closed chrome
chrome.tabs.onupdated.addlistener(function (tabid, changeinfo, tab) { if (changeinfo.status == 'loading' && tab.active) { chrome.debugger.attach({ tabid: tab.id }, version, onattach.bind(null, tab.id)); } }); var version = "1.0"; function onattach(tabid) { if (chrome.runtime.lasterror) { alert(chrome.runtime.lasterror.message); return; } chrome.windows.create({ url: "popup.html?" + tabid , type: "popup" , width: 800 , height: 600 }); }
Comments
Post a Comment