how to see the dump() message in firefox?

前端 未结 3 1012
南笙
南笙 2021-01-17 04:48

I\'m currently developing a firefox extension. I use dump() function. But the messages are not showing up in the console. I\'ve cahnged the value of brows

相关标签:
3条回答
  • 2021-01-17 04:55

    Starting Firefox with -console command line switch is only necessary on Windows. If you are using Linux then you should simply start Firefox from a terminal window. On Mac OS X the console messages can be displayed via some application (sorry, don't remember which one). Also, changing browser.dom.window.dump.enabled is only necessary if you are logging from a window-bound context - in JavaScript modules and such it always works regardless of this preference.

    If you want to have your logging messages available more easily you should be using Components.utils.reportError() (or nsIConsoleService.logStringMessage() as explained in the documentation) - this will send messages to the usual Error Console that can be opened at any time.

    0 讨论(0)
  • 2021-01-17 05:12

    I find this addon to be really helpful when logging errors/messages to the console: https://addons.mozilla.org/en-US/firefox/addon/console%C2%B2/

    0 讨论(0)
  • 2021-01-17 05:20

    To finally get the output from dump(), I specified dump file location by creating a preference browser.dom.window.dump.file and setting it in about:config.

    I believe I had the same issue. I couldn't get dump() to print to stderr nor the console even though I had set browser.dom.window.dump.enabled to true. I'm on Ubuntu 14.04.

    Source: https://developer.mozilla.org/en-US/docs/Mozilla/Preferences/Preference_reference/browser.dom.window.dump.file

    0 讨论(0)
提交回复
热议问题