author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Sat, 10 Feb 2018 01:49:07 +0200 | |
changeset 2230 | 9e6ad6607a9e |
parent 2228 | 837f1337c59b |
permissions | -rw-r--r-- |
1391 | 1 |
.. -*- coding: utf-8; -*- |
2 |
||
3 |
========================== |
|
4 |
Develop with/of Firefox. |
|
5 |
========================== |
|
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 | 8 |
|
1392 | 9 |
Useful Firefox add-ons for developers. |
10 |
====================================== |
|
1391 | 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 | 15 |
Firebug. |
16 |
-------- |
|
17 |
||
18 |
Firebug integrates with Firefox to put a wealth of development tools at your fingertips |
|
19 |
while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any |
|
20 |
web page. |
|
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 | 26 |
|
27 |
Live HTTP Headers. |
|
28 |
------------------ |
|
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 | 35 |
|
36 |
This project may be of some help for the following: |
|
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 | 41 |
|
42 |
Alternatively you can use fiddler2 (only Windows as it written in .NET) |
|
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 | 50 |
|
1514 | 51 |
Wappalyzer. |
52 |
----------- |
|
53 |
||
54 |
Reverse which libraries and frameworks used by page. |
|
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 | 58 |
|
1391 | 59 |
Tamper Data. |
60 |
------------ |
|
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 | 65 |
|
66 |
Based on code and incompotable with "Live HTTP Headers" extensions. |
|
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 | 74 |
|
75 |
Extension security. |
|
76 |
=================== |
|
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 | 80 |
|
81 |
Debugging in Firefox. |
|
82 |
===================== |
|
83 |
||
84 |
For JavaScript:: |
|
85 |
||
86 |
// Enables strict JavaScript warnings in the Error Console. |
|
87 |
user_pref("javascript.options.strict", true); |
|
88 |
// Logs errors in chrome files to the Error Console. Enable Components.utils.reportError(). |
|
89 |
user_pref("javascript.options.showInConsole", true); |
|
90 |
// Disables the XUL cache so that changes to windows and dialogs do not require a restart. |
|
91 |
user_pref("nglayout.debug.disable_xul_cache", true); |
|
92 |
// Enables the use of the dump() statement to print to the standard console. |
|
93 |
user_pref("browser.dom.window.dump.enabled", true); |
|
94 |
// This enables to run JavaScript code snippets in the chrome context of the Scratchpad from the Tools menu. |
|
95 |
user_pref("devtools.chrome.enabled", true); |
|
96 |
// This will send more detailed information about installation and update problems to the Error Console. |
|
97 |
user_pref("extensions.logging.enabled", true); |
|
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 | 104 |
|
1717 | 105 |
Examine ``devtool`` options in ``about:config`` with prefix ``devtools.``:: |
106 |
||
107 |
user_pref("devtools.debugger.enabled", true); |
|
108 |
user_pref("devtools.debugger.pause-on-exceptions", true); |
|
109 |
user_pref("devtools.debugger.auto-pretty-print", true); |
|
110 |
||
111 |
user_pref("devtools.debugger.chrome-debugging-host", "localhost"); |
|
112 |
user_pref("devtools.debugger.chrome-debugging-port", 6080); |
|
113 |
user_pref("devtools.debugger.ignore-caught-exceptions", true); |
|
114 |
user_pref("devtools.debugger.remote-enabled, true); |
|
115 |
user_pref("devtools.debugger.remote-host", "localhost"); |
|
116 |
user_pref("devtools.debugger.remote-port", 6000); |
|
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 | 126 |
|
127 |
Debugging JavaScript with Web Console. |
|
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 | 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 | 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 | 142 |
|
143 |
See: |
|
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 | 148 |
|
149 |
Debugging JavaScript with Firebug. |
|
150 |
---------------------------------- |
|
151 |
||
152 |
With Firebug you can use 'console.log(obj)' for logging. Also output can be grouped with |
|
153 |
console.group("name") to start a new indentation block, and then console.groupEnd(). |
|
154 |
||
155 |
Same but with different coloring do 'console.debug', 'console.info', 'console.warn', and |
|
156 |
'console.error' functions. |
|
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 | 166 |
|
167 |
dump(). |
|
168 |
------- |
|
169 |
||
170 |
Set in ``about:config`` ``browser.dom.window.dump.enabled`` to ``true``. |
|
171 |
||
172 |
All messages go to native console. On Windows this require ``-console`` option |
|
173 |
for ``firefox.exe``. |
|
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 | 176 |
|
177 |
Components.utils.reportError. |
|
178 |
----------------------------- |
|
179 |
||
180 |
Write error msg to Error console (not in Web Console):: |
|
181 |
||
182 |
Components.utils.reportError("msg"); |
|
183 |
// Show the error console. |
|
184 |
toJavaScriptConsole(); |
|
185 |
||
186 |
Firefox 3.x require set preference 'javascript.options.showInConsole' to 'true' |
|
187 |
which is default value fro Firefox 4.x. |
|
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 | 190 |
|
191 |
Build Firefox from sources. |
|
192 |
=========================== |
|
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 | 198 |
|
199 |
Native Firefox debugging. |
|
200 |
========================= |
|
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 | 203 |
|
204 |
Adding symbols from Symbol Server. |
|
205 |
---------------------------------- |
|
206 |
||
207 |
Execute in WinDbg:: |
|
208 |
||
209 |
.sympath SRV*c:\symcache\*http://msdl.microsoft.com/download/symbols;SRV*c:\symcache\*http://symbols.mozilla.org/firefox |
|
210 |
||
211 |
or Ctrl+S and add:: |
|
212 |
||
213 |
SRV*c:\symcache\*http://msdl.microsoft.com/download/symbols;SRV*c:\symcache\*http://symbols.mozilla.org/firefox |
|
214 |
||
215 |
See: |
|
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 |