Chrome extension: Debugger API does not fire event -
i want listen timeline events happened in tab, create extension
chrome.browseraction.onclicked.addlistener(function(tab) { var tabid = tab.id; console.log("tabid = ", tabid); if (running === false) { checkavailable(); chrome.debugger.attach({ tabid: tabid }, protocolversion, function() { running = true; if (chrome.runtime.lasterror) { console.log(chrome.runtime.lasterror.message); return; } chrome.debugger.sendcommand({ tabid: tabid }, "tracing.start", { "maxcallstackdepth" : 5 }, function(response) { console.log(response); // listening responses timeline chrome.debugger.onevent.addlistener(function(tabid, method, params) { console.log("params = ", params); }); }); chrome.debugger.ondetach.addlistener(function (source, reason) { running = false; }); }); } else { chrome.debugger.detach({ tabid: tabid }, null); running = false; } });
after clicking icon see yellow bar @ top of page , message "extension debugging page".
however, after f5 not see extension listen timeline events.
it looks event has not been assigned.
chrome.debugger.onevent.addlistener(function(tabid, method, params) { console.log("params = ", params); });
any ideas?
Comments
Post a Comment