rednoyz
rednoyz

Reputation: 1327

How to debug an XPCOM error from within Javascript

On disabling and re-enabling my addon, I get the error below (I have one simple XPCOM component) -- how might one go about debugging something like this?

Call to xpconnect wrapped JSObject produced this error: * [Exception... "'[JavaScript Error: "can't access dead object" {file: "resource://gre/modules/XPIProvider.jsm -> jar:file:///Users/me/code/testprof/extensions/[email protected]!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/event/chrome.js" line: 36}]' when calling method: [nsIObserver::observe]" nsresult: "0x80570021 (NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS)" location: "JS frame :: resource://gre/modules/XPIProvider.jsm -> jar:file:///Users/me/code/testprof/extensions/[email protected]!/bootstrap.js -> resource://gre/modules/commonjs/toolkit/loader.js -> resource://gre/modules/commonjs/sdk/addon/window.js :: :: line 43" data: yes]

Upvotes: 1

Views: 324

Answers (1)

Noitidart
Noitidart

Reputation: 37238

cant access dead object means, you had set like a global variable to = window. now that window is no longer there.

check your observer, it might be holding a variable with reference to some window or document object.

the way you got that message is the only way to debug, using the browser console (Ctrl+Shift+J) but make sure you have developer preferences set up: https://developer.mozilla.org/en-US/Add-ons/Setting_up_extension_development_environment?redirectlocale=en-US&redirectslug=Setting_up_extension_development_environment#Development_preferences

Upvotes: 0

Related Questions