I tried to investigate, but I failed to find how to debug extensions, and in any case I have no experience with developing them whatsoever. As far as I could understand, the script chrome\js\redirector.js fails to load because LocaleService is undefined, and the debugger just stops executing the main script after that error, so I suspect that's the culprit. LocaleService should be initialized in chrome\js\xpcom.js:
Code: Select all
const LocaleService = Service("@mozilla.org/intl/nslocaleservice;1", "nsILocaleService");
So I'm pretty much stuck here. Any help on either this particular extension, or general extension debugging techniques would be very appreciated.
Also, I'd like to hear if there is any better way to test modified extension, than to edit the files, re-pack them into XPI, reinstall the addon into PM, restart PM, reopen the debugger, reload the page…
And one more thing, is there some option that hides errors from console by default? When I go step-by-step in the script, execute the line
Code: Select all
Components.utils.import("chrome://redirector/content/js/redirector.js");
Code: Select all
ReferenceError: LocaleService is not defined