firefox-devel.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sat, 10 Feb 2018 01:49:07 +0200
changeset 2230 9e6ad6607a9e
parent 2228 837f1337c59b
permissions -rw-r--r--
Fixed formatting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     1
.. -*- coding: utf-8; -*-
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     2
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     3
==========================
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     4
 Develop with/of Firefox.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     5
==========================
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     6
.. contents::
1905
fba288d59662 Include only local subsections into TOC. This prevent duplication of
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1717
diff changeset
     7
   :local:
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
     8
1392
a8c75efa691e Fix header title.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1391
diff changeset
     9
Useful Firefox add-ons for developers.
a8c75efa691e Fix header title.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1391
diff changeset
    10
======================================
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    11
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    12
https://addons.mozilla.org/en-US/firefox/collections/mozilla/webdeveloper/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    13
  Plug-ins for Web-development.
1404
20068801663f Plug-ins for Web-development.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1393
diff changeset
    14
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    15
Firebug.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    16
--------
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    17
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    18
Firebug integrates with Firefox to put a wealth of development tools at your fingertips
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    19
while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    20
web page.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    21
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    22
http://getfirebug.com
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    23
  Home page.
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    24
https://addons.mozilla.org/firefox/addon/1843
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    25
  download page
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    26
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    27
Live HTTP Headers.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    28
------------------
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    29
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    30
* First by adding a 'Headers' tab in 'View Page Info' of a web page.
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    31
* Second by adding a tool in the 'Tools->Web Development' menu to be able to display http
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    32
  headers in real time (while pages are being downloaded from the Internet.
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    33
* Third by letting you edit request headers and replay an URL (beta). Look for the Replay
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    34
  button in the live window!
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    35
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    36
This project may be of some help for the following:
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    37
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    38
* Help debugging web application.
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    39
* See which kind of web server the remote site is using.
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    40
* See the cookies sent by remote site.
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    41
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    42
Alternatively you can use fiddler2 (only Windows as it written in .NET)
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    43
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    44
http://livehttpheaders.mozdev.org/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    45
  home page
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    46
https://addons.mozilla.org/en-US/firefox/addon/3829/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    47
  download page
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    48
http://www.fiddler2.com/fiddler2/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    49
  Web Debugging Proxy
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    50
1514
81d7dd711a43 Wappalyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1407
diff changeset
    51
Wappalyzer.
81d7dd711a43 Wappalyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1407
diff changeset
    52
-----------
81d7dd711a43 Wappalyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1407
diff changeset
    53
81d7dd711a43 Wappalyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1407
diff changeset
    54
Reverse which libraries and frameworks used by page.
81d7dd711a43 Wappalyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1407
diff changeset
    55
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    56
https://addons.mozilla.org/en-US/firefox/addon/wappalyzer/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    57
  download page
1514
81d7dd711a43 Wappalyzer.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1407
diff changeset
    58
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    59
Tamper Data.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    60
------------
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    61
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    62
* Use tamperdata to view and modify HTTP/HTTPS headers and post parameters.
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    63
* Trace and time http response/requests.
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    64
* Security test web applications by modifying POST parameters.
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    65
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    66
Based on code and incompotable with "Live HTTP Headers" extensions.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    67
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    68
http://tamperdata.mozdev.org/index.html
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    69
  home page
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    70
https://addons.mozilla.org/en-US/firefox/addon/966/
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    71
  download page
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    72
http://jimbojw.com/wiki/index.php?title=Tamper_Data
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
    73
  Tamper Data tutorial.
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    74
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    75
Extension security.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    76
===================
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    77
1990
cfc628f229cd https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    78
* https://developer.mozilla.org/en/Security_best_practices_in_extensions
cfc628f229cd https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1912
diff changeset
    79
* https://support.mozilla.org/en-US/kb/add-on-signing-in-firefox
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    80
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    81
Debugging in Firefox.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    82
=====================
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    83
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    84
For JavaScript::
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    85
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    86
  // Enables strict JavaScript warnings in the Error Console.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    87
  user_pref("javascript.options.strict", true);
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    88
  // Logs errors in chrome files to the Error Console. Enable Components.utils.reportError().
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    89
  user_pref("javascript.options.showInConsole", true);
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    90
  // Disables the XUL cache so that changes to windows and dialogs do not require a restart.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    91
  user_pref("nglayout.debug.disable_xul_cache", true);
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    92
  // Enables the use of the dump() statement to print to the standard console.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    93
  user_pref("browser.dom.window.dump.enabled", true);
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    94
  // This enables to run JavaScript code snippets in the chrome context of the Scratchpad from the Tools menu.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    95
  user_pref("devtools.chrome.enabled", true);
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    96
  // This will send more detailed information about installation and update problems to the Error Console.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    97
  user_pref("extensions.logging.enabled", true);
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
    98
  user_pref("dom.report_all_js_exceptions", true);
1516
23ce5096b67f Some more development settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1514
diff changeset
    99
  // This adds a "Browser Debugger" entry to the "Web Developer" submenu of the "Tools" menu.
23ce5096b67f Some more development settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1514
diff changeset
   100
  // The Browser Debugger can be used to debug the JavaScript code of extensions.
23ce5096b67f Some more development settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1514
diff changeset
   101
  user_pref("devtools.debugger.remote-enabled", true);
23ce5096b67f Some more development settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1514
diff changeset
   102
  // Detect deprecated code use.
23ce5096b67f Some more development settings.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1514
diff changeset
   103
  user_pref("devtools.errorconsole.deprecation_warnings", true);
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   104
1717
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   105
Examine ``devtool`` options in ``about:config`` with prefix ``devtools.``::
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   106
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   107
  user_pref("devtools.debugger.enabled", true);
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   108
  user_pref("devtools.debugger.pause-on-exceptions", true);
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   109
  user_pref("devtools.debugger.auto-pretty-print", true);
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   110
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   111
  user_pref("devtools.debugger.chrome-debugging-host", "localhost");
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   112
  user_pref("devtools.debugger.chrome-debugging-port", 6080);
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   113
  user_pref("devtools.debugger.ignore-caught-exceptions", true);
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   114
  user_pref("devtools.debugger.remote-enabled, true);
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   115
  user_pref("devtools.debugger.remote-host", "localhost");
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   116
  user_pref("devtools.debugger.remote-port", 6000);
79628df58b2d devtool options.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1538
diff changeset
   117
2026
9d550f4d9163 https://developer.mozilla.org/en-US/docs/Tools/Debugger
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1990
diff changeset
   118
https://developer.mozilla.org/en/Setting_up_extension_development_environment
9d550f4d9163 https://developer.mozilla.org/en-US/docs/Tools/Debugger
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1990
diff changeset
   119
  Setting up profile, options and about developer plugin.
9d550f4d9163 https://developer.mozilla.org/en-US/docs/Tools/Debugger
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1990
diff changeset
   120
https://developer.mozilla.org/en-US/docs/Tools/Debugger
9d550f4d9163 https://developer.mozilla.org/en-US/docs/Tools/Debugger
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1990
diff changeset
   121
  JavaScript Debugger.
2028
2b864e3d309b https://getfirebug.com/doc/breakpoints/demo.html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2026
diff changeset
   122
https://getfirebug.com/doc/breakpoints/demo.html
2b864e3d309b https://getfirebug.com/doc/breakpoints/demo.html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2026
diff changeset
   123
  Conditional Network Breakpoints. Breakpoints on DOM (HTML) Mutation Events.
2b864e3d309b https://getfirebug.com/doc/breakpoints/demo.html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2026
diff changeset
   124
  Breakpoints on DOM Property Changes. Breakpoints on Errors.
2b864e3d309b https://getfirebug.com/doc/breakpoints/demo.html
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2026
diff changeset
   125
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   126
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   127
Debugging JavaScript with Web Console.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   128
--------------------------------------
1405
c761842c6d90 Debugging JavaScript with Web Console.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1393
diff changeset
   129
c761842c6d90 Debugging JavaScript with Web Console.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1393
diff changeset
   130
Instead of "Error Console" (press Ctrl+Shift+J) use "Web Console" (press
c761842c6d90 Debugging JavaScript with Web Console.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1393
diff changeset
   131
Ctrl+Shift+K) in Firefox >=4.0::
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   132
1517
16607af623bc About "new Error().stack" and console.log("%o").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1516
diff changeset
   133
  console.log("str");
16607af623bc About "new Error().stack" and console.log("%o").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1516
diff changeset
   134
  console.info("str is %s", "str");
16607af623bc About "new Error().stack" and console.log("%o").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1516
diff changeset
   135
  console.warn("this is %o", this);
16607af623bc About "new Error().stack" and console.log("%o").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1516
diff changeset
   136
  console.error("int: %i, float: %f, string: %s, object: %o", 2, .333, "str", this);
16607af623bc About "new Error().stack" and console.log("%o").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1516
diff changeset
   137
16607af623bc About "new Error().stack" and console.log("%o").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1516
diff changeset
   138
To see stack-trace use::
16607af623bc About "new Error().stack" and console.log("%o").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1516
diff changeset
   139
1522
50ff620600c9 console.trace
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1517
diff changeset
   140
  console.trace();
1517
16607af623bc About "new Error().stack" and console.log("%o").
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 1516
diff changeset
   141
  console.log(new Error().stack);
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   142
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   143
See:
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   144
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   145
* https://developer.mozilla.org/en-US/docs/Web/API/console
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   146
* https://developer.mozilla.org/en/Using_the_Web_Console
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   147
* https://developer.mozilla.org/en-US/docs/Tools/Web_Console
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   148
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   149
Debugging JavaScript with Firebug.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   150
----------------------------------
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   151
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   152
With Firebug you can use 'console.log(obj)' for logging. Also output can be grouped with
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   153
console.group("name") to start a new indentation block, and then console.groupEnd().
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   154
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   155
Same but with different coloring do 'console.debug', 'console.info', 'console.warn', and
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   156
'console.error' functions.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   157
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   158
http://getfirebug.com/logging
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   159
  logging
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   160
http://getfirebug.com/wiki/index.php/Console_API
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   161
  Console API
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   162
http://getfirebug.com/wiki/index.php/Command_Line
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   163
  Command Line
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   164
http://getfirebug.com/wiki/index.php/Console_Panel
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   165
  Console Panel
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   166
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   167
dump().
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   168
-------
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   169
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   170
Set in ``about:config`` ``browser.dom.window.dump.enabled`` to ``true``.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   171
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   172
All messages go to native console. On Windows this require ``-console`` option
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   173
for ``firefox.exe``.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   174
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   175
* https://developer.mozilla.org/en/DOM/window.dump
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   176
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   177
Components.utils.reportError.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   178
-----------------------------
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   179
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   180
Write error msg to Error console (not in Web Console)::
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   181
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   182
  Components.utils.reportError("msg");
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   183
  // Show the error console.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   184
  toJavaScriptConsole();
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   185
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   186
Firefox 3.x require set preference 'javascript.options.showInConsole' to 'true'
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   187
which is default value fro Firefox 4.x.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   188
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   189
* https://developer.mozilla.org/en/Components.utils.reportError
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   190
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   191
Build Firefox from sources.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   192
===========================
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   193
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   194
https://developer.mozilla.org/en/Build_Documentation
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   195
  Build Instructions
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   196
https://developer.mozilla.org/en/Mozilla_Source_Code_%28Mercurial%29
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   197
  Getting Mozilla Source Code Using Mercurial
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   198
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   199
Native Firefox debugging.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   200
=========================
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   201
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   202
* https://developer.mozilla.org/en/how_to_get_a_stacktrace_with_windbg
1391
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   203
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   204
Adding symbols from Symbol Server.
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   205
----------------------------------
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   206
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   207
Execute in WinDbg::
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   208
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   209
  .sympath SRV*c:\symcache\*http://msdl.microsoft.com/download/symbols;SRV*c:\symcache\*http://symbols.mozilla.org/firefox
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   210
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   211
or Ctrl+S and add::
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   212
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   213
  SRV*c:\symcache\*http://msdl.microsoft.com/download/symbols;SRV*c:\symcache\*http://symbols.mozilla.org/firefox
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   214
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   215
See:
741a44fc9992 Remove duplicate text.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff changeset
   216
2228
837f1337c59b Removed indentation that compiled into <blockquote>.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents: 2028
diff changeset
   217
* https://developer.mozilla.org/en/Using_the_Mozilla_symbol_server