How do you log to Firebug from an extension?

前端 未结 6 681
灰色年华
灰色年华 2020-12-31 08:08

I\'m writing an extension for Firefox, and I need to log some data to Firebug\'s console. Within the scope of my addon, \"console\" is undefined, and \"window.content.consol

6条回答
  •  忘掉有多难
    2020-12-31 08:42

    If in your extension you have access to the content Window object, you can unwrap it, and call the console methods directly:

    window.wrappedJSObject.console.log('something important');
    

提交回复
热议问题