javascript - How to debug background/event page suspended state -


i debug background script (non persistent) when goes sleep , wakes (and goes sleep again).

clicking on "background page" prevent background script going suspended state, if kill page , open after while, fresh logs displayed, not ones printed before opening background page (from extensions page).

so wondering how debug suspended/wake states of event page?

edit: moved backstory own question here

how prevent/detect race condition between processing , restoring store data when waking event page

you log console , non-volatile storage @ same time.

you can either use custom logging function, or overload console.log:

console._log = console.log; console.log = function() {   var args = arguments;   console._log.apply(console, args);   chrome.storage.local.get({consolelog : []}, function(data) {     data.consolelog.push(args);     chrome.storage.local.set({consolelog: data.consolelog});   }); } 

of course, should used while you're actively debugging.


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -