1391
|
1 |
.. -*- coding: utf-8; -*-
|
|
2 |
.. include:: HEADER.rst
|
|
3 |
|
|
4 |
==========================
|
|
5 |
Develop with/of Firefox.
|
|
6 |
==========================
|
|
7 |
.. contents::
|
|
8 |
|
1392
|
9 |
Useful Firefox add-ons for developers.
|
|
10 |
======================================
|
1391
|
11 |
|
|
12 |
Firebug.
|
|
13 |
--------
|
|
14 |
|
|
15 |
Firebug integrates with Firefox to put a wealth of development tools at your fingertips
|
|
16 |
while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any
|
|
17 |
web page.
|
|
18 |
|
|
19 |
http://getfirebug.com
|
|
20 |
home page
|
|
21 |
https://addons.mozilla.org/firefox/addon/1843
|
|
22 |
download page
|
|
23 |
|
|
24 |
Live HTTP Headers.
|
|
25 |
------------------
|
|
26 |
|
|
27 |
* First by adding a 'Headers' tab in 'View Page Info' of a web page.
|
|
28 |
* Second by adding a tool in the 'Tools->Web Development' menu to be able to display http
|
|
29 |
headers in real time (while pages are being downloaded from the Internet.
|
|
30 |
* Third by letting you edit request headers and replay an URL (beta). Look for the Replay
|
|
31 |
button in the live window!
|
|
32 |
|
|
33 |
This project may be of some help for the following:
|
|
34 |
|
|
35 |
* Help debugging web application.
|
|
36 |
* See which kind of web server the remote site is using.
|
|
37 |
* See the cookies sent by remote site.
|
|
38 |
|
|
39 |
Alternatively you can use fiddler2 (only Windows as it written in .NET)
|
|
40 |
|
|
41 |
http://livehttpheaders.mozdev.org/
|
|
42 |
home page
|
|
43 |
https://addons.mozilla.org/en-US/firefox/addon/3829/
|
|
44 |
download page
|
|
45 |
http://www.fiddler2.com/fiddler2/
|
|
46 |
Web Debugging Proxy
|
|
47 |
|
|
48 |
Tamper Data.
|
|
49 |
------------
|
|
50 |
|
|
51 |
* Use tamperdata to view and modify HTTP/HTTPS headers and post parameters.
|
|
52 |
* Trace and time http response/requests.
|
|
53 |
* Security test web applications by modifying POST parameters.
|
|
54 |
|
|
55 |
Based on code and incompotable with "Live HTTP Headers" extensions.
|
|
56 |
|
|
57 |
http://tamperdata.mozdev.org/index.html
|
|
58 |
home page
|
|
59 |
https://addons.mozilla.org/en-US/firefox/addon/966/
|
|
60 |
download page
|
|
61 |
http://jimbojw.com/wiki/index.php?title=Tamper_Data
|
|
62 |
Tamper Data tutorial.
|
|
63 |
|
|
64 |
Extension security.
|
|
65 |
===================
|
|
66 |
|
|
67 |
* https://developer.mozilla.org/en/Security_best_practices_in_extensions
|
|
68 |
|
|
69 |
Debugging in Firefox.
|
|
70 |
=====================
|
|
71 |
|
|
72 |
For JavaScript::
|
|
73 |
|
|
74 |
// Enables strict JavaScript warnings in the Error Console.
|
|
75 |
user_pref("javascript.options.strict", true);
|
|
76 |
// Logs errors in chrome files to the Error Console. Enable Components.utils.reportError().
|
|
77 |
user_pref("javascript.options.showInConsole", true);
|
|
78 |
// Disables the XUL cache so that changes to windows and dialogs do not require a restart.
|
|
79 |
user_pref("nglayout.debug.disable_xul_cache", true);
|
|
80 |
// Enables the use of the dump() statement to print to the standard console.
|
|
81 |
user_pref("browser.dom.window.dump.enabled", true);
|
|
82 |
// This enables to run JavaScript code snippets in the chrome context of the Scratchpad from the Tools menu.
|
|
83 |
user_pref("devtools.chrome.enabled", true);
|
|
84 |
// This will send more detailed information about installation and update problems to the Error Console.
|
|
85 |
user_pref("extensions.logging.enabled", true);
|
|
86 |
user_pref("dom.report_all_js_exceptions", true);
|
|
87 |
|
|
88 |
See:
|
|
89 |
|
|
90 |
https://developer.mozilla.org/en/Setting_up_extension_development_environment
|
|
91 |
setting up profile, options and about developer plugin
|
|
92 |
|
|
93 |
Debugging JavaScript with Web Console.
|
|
94 |
--------------------------------------
|
|
95 |
::
|
|
96 |
|
|
97 |
'console.log()', 'console.info()', 'console.warn()', 'console.error()'.
|
|
98 |
|
|
99 |
See:
|
|
100 |
|
1393
|
101 |
* https://developer.mozilla.org/en/Using_the_Web_Console
|
|
102 |
* https://developer.mozilla.org/en-US/docs/Tools/Web_Console
|
1391
|
103 |
|
|
104 |
Debugging JavaScript with Firebug.
|
|
105 |
----------------------------------
|
|
106 |
|
|
107 |
With Firebug you can use 'console.log(obj)' for logging. Also output can be grouped with
|
|
108 |
console.group("name") to start a new indentation block, and then console.groupEnd().
|
|
109 |
|
|
110 |
Same but with different coloring do 'console.debug', 'console.info', 'console.warn', and
|
|
111 |
'console.error' functions.
|
|
112 |
|
|
113 |
'console.log' can format strings in the great tradition of printf.
|
|
114 |
|
|
115 |
'console.trace()' - to print trace.
|
|
116 |
|
|
117 |
http://getfirebug.com/logging
|
|
118 |
logging
|
|
119 |
http://getfirebug.com/wiki/index.php/Console_API
|
|
120 |
Console API
|
1393
|
121 |
http://getfirebug.com/wiki/index.php/Command_Line
|
|
122 |
Command Line
|
|
123 |
http://getfirebug.com/wiki/index.php/Console_Panel
|
|
124 |
Console Panel
|
1391
|
125 |
|
|
126 |
dump().
|
|
127 |
-------
|
|
128 |
|
|
129 |
Set in ``about:config`` ``browser.dom.window.dump.enabled`` to ``true``.
|
|
130 |
|
|
131 |
All messages go to native console. On Windows this require ``-console`` option
|
|
132 |
for ``firefox.exe``.
|
|
133 |
|
|
134 |
https://developer.mozilla.org/en/DOM/window.dump
|
|
135 |
|
|
136 |
Components.utils.reportError.
|
|
137 |
-----------------------------
|
|
138 |
|
|
139 |
Write error msg to Error console (not in Web Console)::
|
|
140 |
|
|
141 |
Components.utils.reportError("msg");
|
|
142 |
// Show the error console.
|
|
143 |
toJavaScriptConsole();
|
|
144 |
|
|
145 |
Firefox 3.x require set preference 'javascript.options.showInConsole' to 'true'
|
|
146 |
which is default value fro Firefox 4.x.
|
|
147 |
|
|
148 |
* https://developer.mozilla.org/en/Components.utils.reportError
|
|
149 |
|
|
150 |
Build Firefox from sources.
|
|
151 |
===========================
|
|
152 |
|
|
153 |
https://developer.mozilla.org/en/Build_Documentation
|
|
154 |
Build Instructions
|
|
155 |
https://developer.mozilla.org/en/Mozilla_Source_Code_%28Mercurial%29
|
|
156 |
Getting Mozilla Source Code Using Mercurial
|
|
157 |
|
|
158 |
Native Firefox debugging.
|
|
159 |
=========================
|
|
160 |
|
|
161 |
* https://developer.mozilla.org/en/how_to_get_a_stacktrace_with_windbg
|
|
162 |
|
|
163 |
Adding symbols from Symbol Server.
|
|
164 |
----------------------------------
|
|
165 |
|
|
166 |
Execute in WinDbg::
|
|
167 |
|
|
168 |
.sympath SRV*c:\symcache\*http://msdl.microsoft.com/download/symbols;SRV*c:\symcache\*http://symbols.mozilla.org/firefox
|
|
169 |
|
|
170 |
or Ctrl+S and add::
|
|
171 |
|
|
172 |
SRV*c:\symcache\*http://msdl.microsoft.com/download/symbols;SRV*c:\symcache\*http://symbols.mozilla.org/firefox
|
|
173 |
|
|
174 |
See:
|
|
175 |
|
|
176 |
https://developer.mozilla.org/en/Using_the_Mozilla_symbol_server
|