火狐扩展开发用到的配置及工具


有助于开发的一些配置:

Installing the Developer Profile extension sets up most of the development environment described below.

There is a set of development preferences that, when enabled, allows you to view more information about application activity, thus making debugging easier. However,  these preferences can degrade performance, so you may want to use a separate development profile when you enable these preferences. For more information about Mozilla preferences, refer to the mozillaZine article on "about:config".

Not all preferences are defined by default, and are therefore not listed in about:config by default. You will have to create new (boolean) entries for them.

  • javascript.options.showInConsole = true. Logs errors in chrome files to the Error Console.
  • nglayout.debug.disable_xul_cache = true. Disables the XUL cache so that changes to windows and dialogs do not require a restart. This assumes you're using directories rather than JARs. Changes to XUL overlays will still require reloading of the document overlaid.
  • browser.dom.window.dump.enabled = true. Enables the use of the dump() statement to print to the standard console. See window.dump for more info. You can use nsIConsoleService instead of dump() from a privileged script.
  • javascript.options.strict = true. Enables strict JavaScript warnings in the Error Console. Note that since many people have this setting turned off when developing, you will see lots of warnings for problems with their code in addition to warnings for your own extension. You can filter those with Console2.
  • devtools.chrome.enabled = true. This enables to run JavaScript code snippets in the chrome context of the Scratchpad from the Tools menu. Don't forget to switch from content to browser as context.
  • devtools.debugger.remote-enabled = true. This adds a "Browser Debugger" entry to the "Web Developer" submenu of the "Tools" menu.  The Browser Debugger can be used to debug the JavaScript code of extensions.
  • extensions.logging.enabled = true. This will send more detailed information about installation and update problems to the Error Console. (Note that the extension manager automatically restarts the application at startup sometimes, which may mean you won't have time to see the messages logged before the automatic restart happens. To see them, prevent the automatic restart by setting the environment NO_EM_RESTART to 1 before starting the application.)
  • nglayout.debug.disable_xul_fastload = true. For Gecko 2.0+ (Firefox 4.0+). See this bug for more information. Although the bug has been closed, it is believed that this pref is still relevant.
  • You might also want to set dom.report_all_js_exceptions = true. See Exception logging in JavaScript for details.
  • devtools.errorconsole.deprecation_warnings. Detect deprecated code use.

 

开发工具:

These extensions may help you with your development.

 

 源自:https://developer.mozilla.org/en-US/docs/Setting_up_extension_development_environment

 

posted @ 2013-08-31 20:56  muhawo  阅读(270)  评论(0编辑  收藏  举报