Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Cleaned out old release

  • Loading branch information...
commit 5e1a664f405a2b5b894d7c242d58f10445ab65bd 1 parent 771d38b
wbamberg authored October 18, 2012

Showing 94 changed files with 0 additions and 27,236 deletions. Show diff stats Hide diff stats

  1. 892  dev-guide-source/cfx-tool.md
  2. 46  dev-guide-source/console.md
  3. 68  dev-guide-source/credits.md
  4. 73  dev-guide-source/glossary.md
  5. 146  dev-guide-source/guides/commonjs.md
  6. 124  dev-guide-source/guides/content-scripts/accessing-the-dom.md
  7. 246  dev-guide-source/guides/content-scripts/communicating-with-other-scripts.md
  8. 93  dev-guide-source/guides/content-scripts/index.md
  9. 79  dev-guide-source/guides/content-scripts/loading.md
  10. 71  dev-guide-source/guides/content-scripts/reddit-example.md
  11. 183  dev-guide-source/guides/content-scripts/using-port.md
  12. 184  dev-guide-source/guides/content-scripts/using-postmessage.md
  13. 153  dev-guide-source/guides/events.md
  14. 103  dev-guide-source/guides/firefox-compatibility.md
  15. 181  dev-guide-source/guides/index.md
  16. 218  dev-guide-source/guides/library-detector.md
  17. 117  dev-guide-source/guides/module-search.md
  18. 33  dev-guide-source/guides/program-id.md
  19. 107  dev-guide-source/guides/sdk-vs-xul.md
  20. 119  dev-guide-source/guides/two-types-of-scripts.md
  21. 325  dev-guide-source/guides/xul-migration.md
  22. 16  dev-guide-source/high-level-apis.md
  23. 151  dev-guide-source/index.md
  24. 34  dev-guide-source/low-level-apis.md
  25. 119  dev-guide-source/package-spec.md
  26. 7  dev-guide-source/third-party-apis.md
  27. 88  dev-guide-source/tutorials/add-a-context-menu-item.md
  28. 122  dev-guide-source/tutorials/adding-menus.md
  29. 170  dev-guide-source/tutorials/adding-toolbar-button.md
  30. 344  dev-guide-source/tutorials/annotator/creating.md
  31. 213  dev-guide-source/tutorials/annotator/displaying.md
  32. 31  dev-guide-source/tutorials/annotator/index.md
  33. 63  dev-guide-source/tutorials/annotator/overview.md
  34. 369  dev-guide-source/tutorials/annotator/storing.md
  35. 115  dev-guide-source/tutorials/annotator/widget.md
  36. 105  dev-guide-source/tutorials/chrome.md
  37. 151  dev-guide-source/tutorials/display-a-popup.md
  38. 273  dev-guide-source/tutorials/event-targets.md
  39. 170  dev-guide-source/tutorials/getting-started-with-cfx.md
  40. 244  dev-guide-source/tutorials/index.md
  41. 154  dev-guide-source/tutorials/installation.md
  42. 369  dev-guide-source/tutorials/l10n.md
  43. 73  dev-guide-source/tutorials/list-open-tabs.md
  44. 55  dev-guide-source/tutorials/listen-for-page-load.md
  45. 103  dev-guide-source/tutorials/load-and-unload.md
  46. 67  dev-guide-source/tutorials/logging.md
  47. 247  dev-guide-source/tutorials/mobile.md
  48. 153  dev-guide-source/tutorials/modifying-web-pages-tab.md
  49. 227  dev-guide-source/tutorials/modifying-web-pages-url.md
  50. 57  dev-guide-source/tutorials/open-a-web-page.md
  51. 413  dev-guide-source/tutorials/reusable-modules.md
  52. 208  dev-guide-source/tutorials/troubleshooting.md
  53. 163  dev-guide-source/tutorials/unit-testing.md
  54. 1,128  dev-guide/cfx-tool.html
  55. 353  dev-guide/console.html
  56. 391  dev-guide/credits.html
  57. 379  dev-guide/glossary.html
  58. 456  dev-guide/guides/commonjs.html
  59. 433  dev-guide/guides/content-scripts/accessing-the-dom.html
  60. 537  dev-guide/guides/content-scripts/communicating-with-other-scripts.html
  61. 402  dev-guide/guides/content-scripts/index.html
  62. 397  dev-guide/guides/content-scripts/loading.html
  63. 386  dev-guide/guides/content-scripts/reddit-example.html
  64. 482  dev-guide/guides/content-scripts/using-port.html
  65. 485  dev-guide/guides/content-scripts/using-postmessage.html
  66. 461  dev-guide/guides/events.html
  67. 409  dev-guide/guides/firefox-compatibility.html
  68. 501  dev-guide/guides/index.html
  69. 515  dev-guide/guides/library-detector.html
  70. 433  dev-guide/guides/module-search.html
  71. 352  dev-guide/guides/program-id.html
  72. 423  dev-guide/guides/sdk-vs-xul.html
  73. 428  dev-guide/guides/two-types-of-scripts.html
  74. 605  dev-guide/guides/xul-migration.html
  75. 338  dev-guide/high-level-apis.html
  76. 470  dev-guide/index.html
  77. 360  dev-guide/low-level-apis.html
  78. 450  dev-guide/package-spec.html
  79. 329  dev-guide/third-party-apis.html
  80. 393  dev-guide/tutorials/add-a-context-menu-item.html
  81. 431  dev-guide/tutorials/adding-menus.html
  82. 468  dev-guide/tutorials/adding-toolbar-button.html
  83. 623  dev-guide/tutorials/annotator/creating.html
  84. 507  dev-guide/tutorials/annotator/displaying.html
  85. 356  dev-guide/tutorials/annotator/index.html
  86. 375  dev-guide/tutorials/annotator/overview.html
  87. 651  dev-guide/tutorials/annotator/storing.html
  88. 421  dev-guide/tutorials/annotator/widget.html
  89. 404  dev-guide/tutorials/chrome.html
  90. 460  dev-guide/tutorials/display-a-popup.html
  91. 579  dev-guide/tutorials/event-targets.html
  92. 466  dev-guide/tutorials/getting-started-with-cfx.html
  93. 564  dev-guide/tutorials/index.html
892  dev-guide-source/cfx-tool.md
Source Rendered
... ...
@@ -1,892 +0,0 @@
1  
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
2  
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
3  
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4  
-
5  
-# cfx #
6  
-
7  
-The `cfx` command-line tool gives you access to the SDK documentation and
8  
-development servers as well as testing, running, and building packages.
9  
-`cfx` usage is:
10  
-
11  
-<pre>
12  
-  cfx [options] command [command-specific options]
13  
-</pre>
14  
-
15  
-"Options" are global options applicable to the tool itself or to all
16  
-commands (for example `--help`). `cfx` supports the following global options:
17  
-
18  
-<pre>
19  
-  -h, --help        - show a help message and exit
20  
-  -v, --verbose     - enable lots of output
21  
-</pre>
22  
-
23  
-"Command-specific options" are only
24  
-applicable to a subset of the commands.
25  
-
26  
-## Supported Commands ##
27  
-
28  
-### cfx docs ###
29  
-
30  
-This command displays the documentation for the SDK. The documentation is
31  
-shipped with the SDK in [Markdown](http://daringfireball.net/projects/markdown/)
32  
-format. The first time this command is executed, and any time after the
33  
-Markdown files on disk have changed, `cfx docs` will generate a set of HTML
34  
-pages from them and launch a web browser to display them. If the Markdown files
35  
-haven't changed, `cfx docs` just launches a browser initialized to the set of
36  
-generated pages.
37  
-
38  
-To regenerate the documentation associated with a single file, you can
39  
-specify the file as an argument. For example:
40  
-
41  
-<pre>
42  
-  cfx docs doc/dev-guide-source/addon-development/cfx-tool.md 
43  
-</pre>
44  
-
45  
-This command will regenerate only the HTML page you're reading.
46  
-This is useful if you're iteratively editing a single file, and don't want to wait for cfx to
47  
-regenerate the complete documentation tree.
48  
-
49  
-### cfx init ####
50  
-Create a new directory, change into it, and run `cfx init`.
51  
-
52  
-This command will create an skeleton add-on, as a starting point for your
53  
-own add-on development, with the following file structure:
54  
-
55  
-<pre>
56  
-  README.md
57  
-  package.json
58  
-  data/
59  
-  lib/
60  
-      main.js
61  
-  tests/
62  
-      test-main.js
63  
-  docs/
64  
-      main.md
65  
-</pre>
66  
-
67  
-### cfx run ###
68  
-
69  
-This command is used to run the add-on. Called with no options it looks for a
70  
-file called `package.json` in the current directory, loads the corresponding
71  
-add-on, and runs it under the version of Firefox it finds in the platform's
72  
-default install path.
73  
-
74  
-#### Supported Options #####
75  
-
76  
-You can point `cfx run` at a different `package.json` file using the
77  
-`--pkgdir` option, and pass arguments to your add-on using the
78  
-`--static-args` option.
79  
-
80  
-You can specify a different version of the
81  
-<a href="dev-guide/glossary.html#host-application">host application</a>
82  
-using the `--binary` option, passing in the path to the application binary to
83  
-run. The path may be specified as a full path or may be relative to the current
84  
-directory. But note that the version must be 4.0b7 or later.
85  
-
86  
-`cfx run` runs the host application with a new
87  
-[profile](http://support.mozilla.com/en-US/kb/profiles). You can specify an
88  
-existing profile using the `--profiledir` option, and this gives you access to
89  
-that profile's history, bookmarks, and other add-ons. This enables you to run
90  
-your add-on alongside debuggers like [Firebug](http://getfirebug.com/).
91  
-See <a href="dev-guide/cfx-tool.html#profiledir">
92  
-"Using --profiledir"</a> for more information.
93  
-
94  
-<table>
95  
-<colgroup>
96  
-<col width="30%">
97  
-<col width="70%">
98  
-</colgroup>
99  
-
100  
-<tr>
101  
-  <td>
102  
-    <code>-b BINARY, --binary=BINARY</code>
103  
-  </td>
104  
-  <td>
105  
-    Use the host application binary specified in BINARY. BINARY may be specified as
106  
-    a full path or as a path relative to the current directory.
107  
-  </td>
108  
-</tr>
109  
-
110  
-<tr>
111  
-  <td>
112  
-    <code>--binary-args=CMDARGS</code>
113  
-  </td>
114  
-  <td>
115  
-    <p>Pass <a href="http://kb.mozillazine.org/Command_line_arguments">extra
116  
-    arguments</a> to the binary being executed (for example, Firefox).</p>
117  
-    <p>For example, to pass the
118  
-    <code>-jsconsole</code> argument to Firefox, which will launch the
119  
-    <a href="https://developer.mozilla.org/en/Error_Console">JavaScript
120  
-    Error Console</a>, try the following:</p>
121  
-    <pre>cfx run --binary-args -jsconsole</pre>
122  
-    <p>To pass multiple arguments, or arguments containing spaces, quote them:</p>
123  
-    <pre>cfx run --binary-args '-url "www.mozilla.org" -jsconsole'</pre>
124  
-    </td>
125  
-</tr>
126  
-
127  
-<tr>
128  
-  <td>
129  
-    <code>--extra-packages=EXTRA_PACKAGES</code>
130  
-  </td>
131  
-  <td>
132  
-    Extra packages to include, specified as a comma-separated list of package
133  
-    names. Defaults to <code>addon-kit</code>.
134  
-  </td>
135  
-</tr>
136  
-
137  
-<tr>
138  
-  <td>
139  
-    <code>-g CONFIG, --use-config=CONFIG</code>
140  
-  </td>
141  
-  <td>
142  
-    Pass a set of options by
143  
-    <a href="dev-guide/cfx-tool.html#configurations">referencing a named configuration</a>.
144  
-  </td>
145  
-</tr>
146  
-
147  
-<tr>
148  
-  <td>
149  
-    <code>-p PROFILEDIR, --profiledir=PROFILEDIR</code>
150  
-  </td>
151  
-  <td>
152  
-    <p>Use an existing
153  
-    <a href="http://support.mozilla.com/en-US/kb/profiles">profile</a>
154  
-    located in PROFILEDIR. PROFILEDIR may be specified as
155  
-    a full path or as a path relative to the current directory.</p>
156  
-
157  
-    <p>See <a href="dev-guide/cfx-tool.html#profiledir">
158  
-    "Using --profiledir"</a> for more information.
159  
-  </td>
160  
-</tr>
161  
-
162  
-<tr>
163  
-  <td>
164  
-    <code>--pkgdir=PKGDIR</code>
165  
-  </td>
166  
-  <td>
167  
-    Use an add-on located in PKGDIR. PKGDIR may be specified as
168  
-    a full path or as a path relative to the current directory.
169  
-  </td>
170  
-</tr>
171  
-
172  
-<tr>
173  
-  <td>
174  
-    <code>--static-args=STATIC_ARGS</code>
175  
-  </td>
176  
-  <td>
177  
-    <a href="dev-guide/cfx-tool.html#arguments">Pass arguments to your add-on</a>,
178  
-    in JSON format.
179  
-  </td>
180  
-</tr>
181  
-
182  
-</table>
183  
-
184  
-#### Experimental Options ####
185  
-
186  
-<table>
187  
-<colgroup>
188  
-<col width="30%">
189  
-<col width="70%">
190  
-</colgroup>
191  
-
192  
-<tr>
193  
-  <td>
194  
-    <code>-a APP, --app=APP</code>
195  
-  </td>
196  
-  <td>
197  
-    By default, <code>cfx run</code> uses Firefox as the
198  
-    <a href="dev-guide/glossary.html#host-application">host application</a>.
199  
-    This option enables you to select a different host. You can specify
200  
-    "firefox", "xulrunner", "fennec", or "thunderbird". But note that at
201  
-    present only Firefox is supported.
202  
-  </td>
203  
-</tr>
204  
-
205  
-<tr>
206  
-  <td>
207  
-    <code>--no-run</code>
208  
-  </td>
209  
-  <td>
210  
-    <p>With this option <code>cfx</code> will not execute the command, but
211  
-    will print out the command that it would have used to execute the
212  
-    command.</p>
213  
-    <p>For example, if you type:</p>
214  
-    <pre>
215  
-cfx run ---no-run</pre>
216  
-    <p>you will see something like:</p>
217  
-    <pre>
218  
-To launch the application, enter the following command:
219  
- /path/to/firefox/firefox-bin -profile
220  
- /path/to/profile/tmpJDNlP6.mozrunner -foreground -no-remote</pre>
221  
-    <p>This enables you to run the add-on without going through
222  
-    <code>cfx</code>, which might be useful if you want to run it
223  
-    inside a debugger like GDB.</p>
224  
-  </td>
225  
-</tr>
226  
-
227  
-<tr>
228  
-  <td>
229  
-    <code>--templatedir=TEMPLATEDIR</code>
230  
-  </td>
231  
-  <td>
232  
-    The <code>cfx run</code> command constructs the add-on using a extension
233  
-    template which you can find under the SDK root, in
234  
-    <code>python-lib/cuddlefish/app-extension</code>.
235  
-    Use the <code>--templatedir</code> option to specify a different template.
236  
-    TEMPLATEDIR may be specified as a full path or as a path relative to the
237  
-    current directory.
238  
-  </td>
239  
-</tr>
240  
-
241  
-</table>
242  
-
243  
-#### Internal Options ####
244  
-
245  
-<table>
246  
-<colgroup>
247  
-<col width="30%">
248  
-<col width="70%">
249  
-</colgroup>
250  
-
251  
-<tr>
252  
-  <td>
253  
-    <code>--addons=ADDONS</code>
254  
-  </td>
255  
-  <td>
256  
-    Paths of add-ons to install, comma-separated. ADDONS may be specified as
257  
-    a full path or as a path relative to the current directory.
258  
-  </td>
259  
-</tr>
260  
-
261  
-<tr>
262  
-  <td>
263  
-    <code>--e10s</code>
264  
-  </td>
265  
-  <td>
266  
-    If this option is set then the add-on runs in a separate process.
267  
-    This option is currently not implemented.
268  
-  </td>
269  
-</tr>
270  
-
271  
-<tr>
272  
-  <td>
273  
-    <code>--keydir=KEYDIR</code>
274  
-  </td>
275  
-  <td>
276  
-    Supply a different location for
277  
-    <a href="dev-guide/guides/program-id.html">signing keys</a>.
278  
-    KEYDIR may be specified as a full path or as a path relative to the
279  
-    current directory.
280  
-  </td>
281  
-</tr>
282  
-
283  
-</table>
284  
-
285  
-### cfx test ###
286  
-
287  
-Run available tests for the specified package.
288  
-
289  
-<span class="aside">Note the hyphen after "test" in the module name.
290  
-`cfx test` will include a module called "test-myCode.js", but will exclude
291  
-modules called "test_myCode.js" or "testMyCode.js".</span>
292  
-
293  
-Called with no options this command will look for a file called `package.json`
294  
-in the current directory. If `package.json` exists, `cfx` will load the
295  
-corresponding add-on, load from the `tests` directory
296  
-any modules that start with the word `test-` and run the unit tests
297  
-they contain.
298  
-
299  
-See the
300  
-[tutorial on unit testing](dev-guide/tutorials/unit-testing.html) and the
301  
-[reference documentation for the `assert` module](packages/api-utils/test/assert.html)
302  
-for details.
303  
-
304  
-#### Supported Options #####
305  
-
306  
-As with `cfx run` you can use options to control which host application binary
307  
-version to use, and to select a profile.
308  
-
309  
-You can also control which tests are run: you
310  
-can test dependent packages, filter the tests by name and run tests multiple
311  
-times.
312  
-
313  
-<table>
314  
-<colgroup>
315  
-<col width="30%">
316  
-<col width="70%">
317  
-</colgroup>
318  
-
319  
-<tr>
320  
-  <td>
321  
-    <code>-b BINARY, --binary=BINARY</code>
322  
-  </td>
323  
-  <td>
324  
-    Use the host application binary specified in BINARY. BINARY may be specified as
325  
-    a full path or as a path relative to the current directory.
326  
-  </td>
327  
-</tr>
328  
-
329  
-<tr>
330  
-  <td>
331  
-    <code>--binary-args=CMDARGS</code>
332  
-  </td>
333  
-  <td>
334  
-    <p>Pass <a href="http://kb.mozillazine.org/Command_line_arguments">extra
335  
-    arguments</a> to the binary being executed (for example, Firefox).</p>
336  
-    <p>For example, to pass the
337  
-    <code>-jsconsole</code> argument to Firefox, which will launch the
338  
-    <a href="https://developer.mozilla.org/en/Error_Console">JavaScript
339  
-    Error Console</a>, try the following:</p>
340  
-    <pre>cfx run --binary-args -jsconsole</pre>
341  
-    <p>To pass multiple arguments, or arguments containing spaces, quote them:</p>
342  
-    <pre>cfx run --binary-args '-url "www.mozilla.org" -jsconsole'</pre>
343  
-    </td>
344  
-</tr>
345  
-
346  
-<tr>
347  
-  <td>
348  
-    <code>--dependencies</code>
349  
-  </td>
350  
-  <td>
351  
-    Load and run any tests that are included with packages that your package
352  
-    depends on.
353  
-    <br>
354  
-    For example: if your add-on depends on <code>addon-kit</code> and you
355  
-    supply this option, then <code>cfx</code> will run the unit tests for
356  
-    <code>addon-kit</code> as well as those for your add-on.
357  
-  </td>
358  
-</tr>
359  
-
360  
-<tr>
361  
-  <td>
362  
-    <code>-f FILTER, --filter=FILTER</code>
363  
-  </td>
364  
-  <td>
365  
-    Run only those test modules whose names match the regexp supplied in
366  
-    FILTER.
367  
-    <br>
368  
-    For example: if you specify <code>--filter data</code>, then
369  
-    <code>cfx</code> will only run tests in those modules whose name contain
370  
-    the string "data".
371  
-  </td>
372  
-</tr>
373  
-
374  
-<tr>
375  
-  <td>
376  
-    <code>-g CONFIG, --use-config=CONFIG</code>
377  
-  </td>
378  
-  <td>
379  
-    Pass a set of options by
380  
-    <a href="dev-guide/cfx-tool.html#configurations">referencing a named configuration</a>.
381  
-  </td>
382  
-</tr>
383  
-
384  
-<tr>
385  
-  <td>
386  
-    <code>-p PROFILEDIR, --profiledir=PROFILEDIR</code>
387  
-  </td>
388  
-  <td>
389  
-    <p>Use an existing
390  
-    <a href="http://support.mozilla.com/en-US/kb/profiles">profile</a>
391  
-    located in PROFILEDIR. PROFILEDIR may be specified as
392  
-    a full path or as a path relative to the current directory.</p>
393  
-
394  
-    <p>See <a href="dev-guide/cfx-tool.html#profiledir">
395  
-    "Using --profiledir"</a> for more information.
396  
-  </td>
397  
-</tr>
398  
-
399  
-<tr>
400  
-  <td>
401  
-    <code>--times=ITERATIONS</code>
402  
-  </td>
403  
-  <td>
404  
-    Execute tests ITERATIONS number of times.
405  
-  </td>
406  
-</tr>
407  
-
408  
-</table>
409  
-
410  
-#### Experimental Options ####
411  
-
412  
-<table>
413  
-<colgroup>
414  
-<col width="30%">
415  
-<col width="70%">
416  
-</colgroup>
417  
-
418  
-<tr>
419  
-  <td>
420  
-    <code>-a APP, --app=APP</code>
421  
-  </td>
422  
-  <td>
423  
-    By default, <code>cfx test</code> uses Firefox as the
424  
-    <a href="dev-guide/glossary.html#host-application">host application</a>.
425  
-    This option enables you to select a different host. You can specify
426  
-    "firefox", "xulrunner", "fennec", or "thunderbird". But note that at
427  
-    present only Firefox is supported.
428  
-  </td>
429  
-</tr>
430  
-
431  
-<tr>
432  
-  <td>
433  
-    <code>--no-run</code>
434  
-  </td>
435  
-  <td>
436  
-    <p>With this option <code>cfx</code> will not execute the command, but
437  
-    will print out the command that it would have used to execute the
438  
-    command.</p>
439  
-    <p>For example, if you type:</p>
440  
-    <pre>
441  
-cfx run ---no-run</pre>
442  
-    <p>you will see something like:</p>
443  
-    <pre>
444  
-To launch the application, enter the following command:
445  
- /path/to/firefox/firefox-bin -profile
446  
- /path/to/profile/tmpJDNlP6.mozrunner -foreground -no-remote</pre>
447  
-    <p>This enables you to run the add-on without going through
448  
-    <code>cfx</code>, which might be useful if you want to run it
449  
-    inside a debugger like GDB.</p>
450  
-  </td>
451  
-</tr>
452  
-
453  
-<tr>
454  
-  <td>
455  
-    <code>--use-server</code>
456  
-  </td>
457  
-  <td>
458  
-    Run tests using a server previously started with <code>cfx develop</code>.
459  
-  </td>
460  
-</tr>
461  
-
462  
-</table>
463  
-
464  
-#### Internal Options ####
465  
-
466  
-<table>
467  
-<colgroup>
468  
-<col width="30%">
469  
-<col width="70%">
470  
-</colgroup>
471  
-
472  
-<tr>
473  
-  <td>
474  
-    <code>--addons=ADDONS</code>
475  
-  </td>
476  
-  <td>
477  
-    Paths of add-ons to install, comma-separated.
478  
-    ADDONS may be specified as full paths or relative to the
479  
-    current directory.
480  
-  </td>
481  
-</tr>
482  
-
483  
-<tr>
484  
-  <td>
485  
-    <code>--e10s</code>
486  
-  </td>
487  
-  <td>
488  
-    If this option is set then the add-on runs in a separate process.
489  
-    This option is currently not implemented.
490  
-  </td>
491  
-</tr>
492  
-
493  
-<tr>
494  
-  <td>
495  
-    <code>--keydir=KEYDIR</code>
496  
-  </td>
497  
-  <td>
498  
-    Supply a different location for
499  
-    <a href="dev-guide/guides/program-id.html">signing keys</a>.
500  
-    KEYDIR may be specified as a full path or as a path relative to the
501  
-    current directory.
502  
-  </td>
503  
-</tr>
504  
-
505  
-<tr>
506  
-  <td>
507  
-    <code>--logfile=LOGFILE</code>
508  
-  </td>
509  
-  <td>
510  
-    Log console output to the file specified by LOGFILE.
511  
-    LOGFILE may be specified as a full path or as a path relative to the
512  
-    current directory.
513  
-  </td>
514  
-</tr>
515  
-
516  
-<tr>
517  
-  <td>
518  
-    <code>--profile-memory=PROFILEMEMORY</code>
519  
-  </td>
520  
-  <td>
521  
-    If this option is given and PROFILEMEMORY is any non-zero integer, then
522  
-    <code>cfx</code> dumps detailed memory usage information to the console
523  
-    when the tests finish.
524  
-  </td>
525  
-</tr>
526  
-
527  
-<tr>
528  
-  <td>
529  
-    <code>--test-runner-pkg=TEST_RUNNER_PKG</code>
530  
-  </td>
531  
-  <td>
532  
-    Name of package containing test runner program. Defaults to
533  
-    <code>test-harness</code>.
534  
-  </td>
535  
-</tr>
536  
-
537  
-</table>
538  
-
539  
-### cfx xpi ###
540  
-
541  
-This tool is used to package your add-on as an
542  
-[XPI](https://developer.mozilla.org/en/XPI) file, which is the install file
543  
-format for Mozilla add-ons.
544  
-
545  
-Called with no options, this command looks for a file called `package.json` in
546  
-the current directory and creates the corresponding XPI file.
547  
-
548  
-Once you have built an XPI file you can distribute your add-on by submitting
549  
-it to [addons.mozilla.org](http://addons.mozilla.org).
550  
-
551  
-#### updateURL and updateLink ####
552  
-
553  
-If you choose to host the XPI yourself you should enable the host application
554  
-to find new versions of your add-on.
555  
-
556  
-To do this, include a URL in the XPI called the
557  
-[updateURL](https://developer.mozilla.org/en/install_manifests#updateURL): the
558  
-host application will go here to get information about updates. At the
559  
-`updateURL` you host a file in the
560  
-[update RDF](https://developer.mozilla.org/en/extension_versioning,_update_and_compatibility#Update_RDF_Format)
561  
-format: among other things, this includes another URL called `updateLink` which
562  
-points to the updated XPI itself.
563  
-
564  
-The `--update-link` and `--update-url` options simplify this process.
565  
-Both options take a URL as an argument.
566  
-
567  
-The `--update-link` option builds an update RDF alongside the XPI, and embeds
568  
-the supplied URL in the update RDF as the value of `updateLink`.
569  
-
570  
-The `--update-url` option embeds the supplied URL in the XPI file, as the value
571  
-of `updateURL`.
572  
-
573  
-Note that as the [add-on documentation](https://developer.mozilla.org/en/extension_versioning,_update_and_compatibility#Securing_Updates)
574  
-explains, you should make sure the update procedure for your add-on is secure,
575  
-and this usually involves using HTTPS for the links.
576  
-
577  
-So if we run the following command:
578  
-
579  
-<pre>
580  
-  cfx xpi --update-link https://example.com/addon/latest
581  
-          --update-url https://example.com/addon/update_rdf
582  
-</pre>
583  
-
584  
-`cfx` will create two files:
585  
-
586  
-* an XPI file which embeds
587  
-`https://example.com/addon/update_rdf` as the value of `updateURL`
588  
-* an RDF file which embeds `https://example.com/addon/latest` as the value of
589  
-`updateLink`.
590  
-
591  
-#### Supported Options ####
592  
-
593  
-As with `cfx run` you can point `cfx` at a different `package.json` file using
594  
-the `--pkgdir` option. You can also embed arguments in the XPI using the
595  
-`--static-args` option: if you do this the arguments will be passed to your
596  
-add-on whenever it is run.
597  
-
598  
-<table>
599  
-<colgroup>
600  
-<col width="50%">
601  
-<col width="50%">
602  
-</colgroup>
603  
-
604  
-<tr>
605  
-  <td>
606  
-    <code>--extra-packages=EXTRA_PACKAGES</code>
607  
-  </td>
608  
-  <td>
609  
-   Extra packages to include, specified as a comma-separated list of package
610  
-   names. Defaults to <code>addon-kit</code>.
611  
-  </td>
612  
-</tr>
613  
-
614  
-<tr>
615  
-  <td>
616  
-    <code>-g CONFIG, --use-config=CONFIG</code>
617  
-  </td>
618  
-  <td>
619  
-    Pass a set of options by
620  
-    <a href="dev-guide/cfx-tool.html#configurations">referencing a named configuration</a>.
621  
-  </td>
622  
-</tr>
623  
-
624  
-<tr>
625  
-  <td>
626  
-    <code>--pkgdir=PKGDIR</code>
627  
-  </td>
628  
-  <td>
629  
-    Use an add-on located in PKGDIR.
630  
-    PKGDIR may be specified as a full path or as a path relative to the
631  
-    current directory.
632  
-  </td>
633  
-</tr>
634  
-
635  
-<tr>
636  
-  <td>
637  
-    <code>--static-args=STATIC_ARGS</code>
638  
-  </td>
639  
-  <td>
640  
-    <a href="dev-guide/cfx-tool.html#arguments">Pass arguments to your add-on</a>,
641  
-    in JSON format.
642  
-  </td>
643  
-</tr>
644  
-
645  
-<tr>
646  
-  <td>
647  
-    <code>--update-link=UPDATE_LINK</code>
648  
-  </td>
649  
-  <td>
650  
-    Build an
651  
-    <a href="https://developer.mozilla.org/en/extension_versioning,_update_and_compatibility#Update_RDF_Format">update RDF</a>
652  
-    alongside the XPI file, and embed the URL supplied in UPDATE_LINK in it as
653  
-    the value of <code>updateLink</code>.
654  
-  </td>
655  
-</tr>
656  
-
657  
-<tr>
658  
-  <td>
659  
-    <code>--update-link=UPDATE_URL</code>
660  
-  </td>
661  
-  <td>
662  
-    Embed the URL supplied in UPDATE_URL in the XPI file, as the value
663  
-    of <code>updateURL</code>.
664  
-  </td>
665  
-</tr>
666  
-
667  
-</table>
668  
-
669  
-#### Experimental Options ####
670  
-
671  
-<table>
672  
-<colgroup>
673  
-<col width="50%">
674  
-<col width="50%">
675  
-</colgroup>
676  
-
677  
-<tr>
678  
-  <td>
679  
-    <code>--templatedir=TEMPLATEDIR</code>
680  
-  </td>
681  
-  <td>
682  
-    The <code>cfx xpi</code> command constructs the add-on using a extension
683  
-    template which you can find under the SDK root, in
684  
-    <code>python-lib/cuddlefish/app-extension</code>.
685  
-    Use the <code>--templatedir</code> option to specify a different template.
686  
-    TEMPLATEDIR may be specified as a full path or as a path relative to the
687  
-    current directory.
688  
-  </td>
689  
-</tr>
690  
-
691  
-</table>
692  
-
693  
-#### Internal Options ####
694  
-
695  
-<table>
696  
-<colgroup>
697  
-<col width="50%">
698  
-<col width="50%">
699  
-</colgroup>
700  
-
701  
-<tr>
702  
-  <td>
703  
-    <code>--keydir=KEYDIR</code>
704  
-  </td>
705  
-  <td>
706  
-    Supply a different location for
707  
-    <a href="dev-guide/guides/program-id.html">signing keys</a>.
708  
-    KEYDIR may be specified as a full path or as a path relative to the
709  
-    current directory.
710  
-  </td>
711  
-</tr>
712  
-
713  
-</table>
714  
-
715  
-## Experimental Commands ##
716  
-
717  
-### cfx develop ###
718  
-
719  
-This initiates an instance of a host application in development mode,
720  
-and allows you to pipe commands into it from another shell without
721  
-having to constantly restart it. Aside from convenience, for SDK
722  
-Platform developers this has the added benefit of making it easier to
723  
-detect leaks.
724  
-
725  
-For example, in shell A, type:
726  
-
727  
-<pre>
728  
-  cfx develop
729  
-</pre>
730  
-
731  
-In shell B, type:
732  
-
733  
-<pre>
734  
-  cfx test --use-server
735  
-</pre>
736  
-
737  
-This will send `cfx test --use-server` output to shell A. If you repeat the
738  
-command in shell B, `cfx test --use-server` output will appear again in shell A
739  
-without restarting the host application.
740  
-
741  
-`cfx develop` doesn't take any options.
742  
-
743  
-## Internal Commands ##
744  
-
745  
-### cfx sdocs ###
746  
-
747  
-Executing this command builds a static HTML version of the SDK documentation
748  
-that can be hosted on a web server without the special application support
749  
-required by `cfx docs`.
750  
-
751  
-#### Options ####
752  
-
753  
-<table>
754  
-<colgroup>
755  
-<col width="50%">
756  
-<col width="50%">
757  
-</colgroup>
758  
-
759  
-<tr>
760  
-  <td>
761  
-    <code>--baseurl=BASEURL</code>
762  
-  </td>
763  
-  <td>
764  
-    The root of the static docs tree, for example:
765  
-    <code>http://example.com/sdk-docs/</code>.
766  
-  </td>
767  
-</tr>
768  
-
769  
-</table>
770  
-
771  
-### cfx testcfx ###
772  
-
773  
-This will run a number of tests on the cfx tool, including tests against the
774  
-documentation. Use `cfx testcfx -v` for the specific list of tests.
775  
-
776  
-This accepts the same options as `cfx test`.
777  
-
778  
-### cfx testpkgs ###
779  
-
780  
-This will test all of the available CommonJS packages. Note that the number
781  
-of tests run and their success depends on what application they are run
782  
-with, and which binary is used.
783  
-
784  
-This accepts the same options as `cfx test`.
785  
-
786  
-### cfx testex ###
787  
-
788  
-This will test all available example code. Note that the number
789  
-of tests run and their success depends on what application they are run
790  
-with, and which binary is used.
791  
-
792  
-This accepts the same options as `cfx test`.
793  
-
794  
-### cfx testall ###
795  
-
796  
-This will test *everything*: the cfx tool, all available CommonJS packages,
797  
-and all examples.
798  
-
799  
-This accepts the same options as `cfx test`.
800  
-
801  
-## <a name="profiledir">Using --profiledir</a> ##
802  
-
803  
-By default, `cfx run` and `cfx test` use a new profile each time they
804  
-are executed. This means that any profile-specific data entered from
805  
-one run of `cfx` will not, by default, be available in the next run.
806  
-
807  
-This includes, for example, any extra add-ons you installed, or your
808  
-history, or any data stored using the
809  
-[simple-storage](packages/addon-kit/simple-storage.html) API.
810  
-
811  
-To make `cfx` use a specific profile, pass the `--profiledir` option,
812  
-specifying the path to the profile you wish to use.
813  
-
814  
-If you give `--profiledir` a path to a nonexistent profile, `cfx`
815  
-will create a profile there for you. So you just have to make up
816  
-a path and name the first time, and keep using it:
817  
-
818  
-<pre>
819  
-cfx run --profiledir="~/addon-dev/profiles/boogaloo"
820  
-</pre>
821  
-
822  
-The path must contain at least one "/" (although you may specify
823  
-just "./dir").
824  
-
825  
-## <a name="configurations">Using Configurations</a> ##
826  
-
827  
-The `--use-config` option enables you to specify a set of options as a named
828  
-configuration in a file, then pass them to `cfx` by referencing the named set.
829  
-
830  
-You define configurations in a file called `local.json` which should live
831  
-in the root directory of your SDK. Configurations are listed under a key called
832  
-"configs".
833  
-
834  
-Suppose your the following `local.json` is as follows:
835  
-
836  
-<pre>
837  
-  {
838  
-      "configs": {
839  
-          "ff40": ["-b", "/usr/bin/firefox-4.0"]
840  
-      }
841  
-  }
842  
-</pre>
843  
-
844  
-You can run:
845  
-
846  
-<pre>
847  
-  cfx test --use-config=ff40
848  
-</pre>
849  
-
850  
-And it would be equivalent to:
851  
-
852  
-<pre>
853  
-  cfx test -a firefox -b /usr/bin/firefox-4.0
854  
-</pre>
855  
-
856  
-This method of defining configuration options can be used for all of the `run`,
857  
-build, and test tools. If "default" is defined in the `local.json` cfx will use
858  
-that configuration unless otherwise specified.
859  
-
860  
-## <a name="arguments">Passing Static Arguments</a> ##
861  
-
862  
-You can use the cfx `--static-args` option to pass arbitrary data to your
863  
-program.  This may be especially useful if you run cfx from a script.
864  
-
865  
-The value of `--static-args` must be a JSON string.  The object encoded by the
866  
-JSON becomes the `staticArgs` member of the `options` object passed as the
867  
-first argument to your program's `main` function.  The default value of
868  
-`--static-args` is `"{}"` (an empty object), so you don't have to worry about
869  
-checking whether `staticArgs` exists in `options`.
870  
-
871  
-For example, if your `main.js` looks like this:
872  
-
873  
-    exports.main = function (options, callbacks) {
874  
-      console.log(options.staticArgs.foo);
875  
-    };
876  
-
877  
-And you run cfx like this:
878  
-
879  
-<pre>
880  
-  cfx run --static-args="{ \"foo\": \"Hello from the command line\" }"
881  
-</pre>
882  
-
883  
-Then your console should contain this:
884  
-
885  
-<pre>
886  
-  info: Hello from the command line
887  
-</pre>
888  
-
889  
-The `--static-args` option is recognized by two of the package-specific
890  
-commands: `run` and `xpi`.  When used with the `xpi` command, the JSON is
891  
-packaged with the XPI's harness options and will therefore be used whenever the
892  
-program in the XPI is run.
46  dev-guide-source/console.md
Source Rendered
... ...
@@ -1,46 +0,0 @@
1  
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
2  
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
3  
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4  
-
5  
-# console #
6  
-
7  
-The `console` object enables your add-on to log messages. If you have started
8  
-the host application for your add-on from the command line (for example, by
9  
-executing `cfx run` or `cfx test`) then these messages appear in the command
10  
-shell you used. If the add-on has been installed in the host application, then
11  
-the messages appear in the host application's
12  
-[Error Console](https://developer.mozilla.org/en/Error_Console).
13  
-
14  
-The `console` object has the following methods:
15  
-
16  
-<code>console.**log**(*object*[, *object*, ...])</code>
17  
-
18  
-Logs an informational message to the shell.
19  
-Depending on the console's underlying implementation and user interface,
20  
-you may be able to introspect into the properties of non-primitive objects
21  
-that are logged.
22  
-
23  
-<code>console.**info**(*object*[, *object*, ...])</code>
24  
-
25  
-A synonym for `console.log()`.
26  
-
27  
-<code>console.**warn**(*object*[, *object*, ...])</code>
28  
-
29  
-Logs a warning message.
30  
-
31  
-<code>console.**error**(*object*[, *object*, ...])</code>
32  
-
33  
-Logs an error message.
34  
-
35  
-<code>console.**debug**(*object*[, *object*, ...])</code>
36  
-
37  
-Logs a debug message.
38  
-
39  
-<code>console.**exception**(*exception*)</code>
40  
-
41  
-Logs the given exception instance as an error, outputting information
42  
-about the exception's stack traceback if one is available.
43  
-
44  
-<code>console.**trace**()</code>
45  
-
46  
-Logs a stack trace at the point this function is called.
68  dev-guide-source/credits.md
Source Rendered
... ...
@@ -1,68 +0,0 @@
1  
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
2  
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
3  
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4  
-
5  
-# Credits #
6  
-
7  
-We'd like to thank our many Jetpack project contributors!  They include:
8  
-
9  
-* Adamantium
10  
-* Ehsan Akhgari
11  
-* arky
12  
-* [Heather Arthur](https://github.com/harthur)
13  
-* Dietrich Ayala
14  
-* [Romain B](https://github.com/Niamor)
15  
-* Will Bamberg
16  
-* Zbigniew Braniecki
17  
-* Daniel Buchner
18  
-* James Burke
19  
-* [Shane Caraveo](https://github.com/mixedpuppy)
20  
-* [Matěj Cepl](https://github.com/mcepl)
21  
-* Hernán Rodriguez Colmeiro
22  
-* [David Creswick](https://github.com/dcrewi)
23  
-* dexter
24  
-* [Matteo Ferretti (ZER0)](https://github.com/ZER0)
25  
-* fuzzykiller
26  
-* [Marcio Galli](https://github.com/taboca)
27  
-* [Ben Gillbanks](http://www.iconfinder.com/browse/iconset/circular_icons/)
28  
-* Felipe Gomes
29  
-* Irakli Gozalishvili
30  
-* Luca Greco
31  
-* Mark Hammond
32  
-* Lloyd Hilaiel
33  
-* Bobby Holley
34  
-* Eric H. Jung
35  
-* Hrishikesh Kale
36  
-* Wes Kocher
37  
-* Edward Lee
38  
-* Myk Melez
39  
-* Zandr Milewski
40  
-* Noelle Murata
41  
-* Joe R. Nassimian ([placidrage](https://github.com/placidrage))
42  
-* Nick Nguyen
43  
-* [ongaeshi](https://github.com/ongaeshi)
44  
-* Paul O’Shannessy
45  
-* l.m.orchard
46  
-* Alexandre Poirot
47  
-* Nickolay Ponomarev
48  
-* Aza Raskin
49  
-* Till Schneidereit
50  
-* Justin Scott
51  
-* Ayan Shah
52  
-* [skratchdot](https://github.com/skratchdot)
53  
-* [Mihai Sucan](https://github.com/mihaisucan)
54  
-* Clint Talbert
55  
-* Thomas
56  
-* Dave Townsend
57  
-* Peter Van der Beken
58  
-* Atul Varma
59  
-* [Erik Vold](https://github.com/erikvold)
60  
-* Vladimir Vukicevic
61  
-* Brian Warner
62  
-* [Henri Wiechers](https://github.com/hwiechers)
63  
-* Drew Willcoxon
64  
-* Piotr Zalewa
65  
-* [David Guo](https://github.com/dglol)
66  
-* [Nils Maier](https://github.com/nmaier)
67  
-* [Louis-Rémi Babé](https://github.com/louisremi)
68  
-* [Matthias Tylkowski](https://github.com/tylkomat)
73  dev-guide-source/glossary.md
Source Rendered
... ...
@@ -1,73 +0,0 @@
1  
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
2  
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
3  
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4  
-
5  
-# Glossary #
6  
-
7  
-This glossary contains a list of terms used in the Add-on SDK.
8  
-
9  
-__Add-on__: A software package that adds functionality to a Mozilla application,
10  
-which can be built with either Mozilla's traditional add-on platform or the SDK.
11  
-
12  
-__Add-on SDK__: A toolchain and associated applications for developing add-ons.
13  
-
14  
-__API Utils__: A small, self-contained set of low-level modules that forms
15  
-the base functionality for the SDK. The library can be "bootstrapped" into
16  
-any Mozilla application or add-on.
17  
-
18  
-__CFX__: A command-line build, testing, and packaging tool for SDK-based code.
19  
-
20  
-__CommonJS__: A specification for a cross-platform JavaScript module
21  
-system and standard library.  [Web site](http://commonjs.org/).
22  
-
23  
-__Extension__: Synonym for Add-on.
24  
-
25  
-__Globals__: The set of global variables and objects provided
26  
-to all modules, such as `console` and `memory`. Includes
27  
-CommonJS globals like `require` and standard JavaScript globals such
28  
-as `Array` and `Math`.
29  
-
30  
-<span><a name="host-application">__Host Application__:</a> Add-ons are executed in
31  
-the context of a host application, which is the application they are extending.
32  
-Firefox and Thunderbird are the most obvious hosts for Mozilla add-ons, but
33  
-at present only Firefox is supported as a host for add-ons developed using the
34  
-Add-on SDK.</span>
35  
-
36  
-__Jetpack Prototype__: A Mozilla Labs experiment that predated and inspired
37  
-the SDK. The SDK incorporates many ideas and some code from the prototype.
38  
-
39  
-__Loader__: An object capable of finding, evaluating, and
40  
-exposing CommonJS modules to each other in a given security context,
41  
-while providing each module with necessary globals and
42  
-enforcing security boundaries between the modules as necessary. It's
43  
-entirely possible for Loaders to create new Loaders.
44  
-
45  
-__Low-Level Module__: A module with the following properties:
46  
-
47  
-  * Has "chrome" access to the Mozilla platform (e.g. `Components.classes`)
48  
-    and all globals.
49  
-  * Is reloadable without leaking memory.
50  
-  * Logs full exception tracebacks originating from client-provided
51  
-    callbacks (i.e., does not allow the exceptions to propagate into
52  
-    Mozilla platform code).
53  
-  * Can exist side-by-side with multiple instances and versions of
54  
-    itself.
55  
-  * Contains documentation on security concerns and threat modeling.
56  
-
57  
-__Module__: A CommonJS module that is either a Low-Level Module
58  
-or an Unprivileged Module.
59  
-
60  
-__Package__: A directory structure containing modules,
61  
-documentation, tests, and related metadata. If a package contains
62  
-a program and includes proper metadata, it can be built into
63  
-a Mozilla application or add-on.
64  
-
65  
-__Program__: A module named `main` that optionally exports
66  
-a `main()` function.  This module is intended either to start an application for
67  
-an end-user or add features to an existing application.
68  
-
69  
-__Unprivileged Module__: A CommonJS module that may be run
70  
-without unrestricted access to the Mozilla platform, and which may use
71  
-all applicable globals that don't require chrome privileges.
72  
-
73  
-  [Low-Level Module Best Practices]: dev-guide/module-development/best-practices.html
146  dev-guide-source/guides/commonjs.md
Source Rendered
... ...
@@ -1,146 +0,0 @@
1  
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
2  
-   - License, v. 2.0. If a copy of the MPL was not distributed with this
3  
-   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
4  
-
5  
-# CommonJS, Packages, and the SDK #
6  
-
7  
-CommonJS is the underlying infrastructure for both the SDK and the add-ons
8  
-you build using the SDK.
9  
-
10  
-The [CommonJS group](http://wiki.commonjs.org/wiki/CommonJS) defines
11  
-specifications for **modules** and **packages**.
12  
-
13  
-## CommonJS Modules ##
14  
-
15  
-A CommonJS **module** is a piece of reusable JavaScript: it exports certain
16  
-objects which are thus made available to dependent code. To facilitate this
17  
-CommonJS defines:
18  
-
19  
-* an object called `exports` which contains all the objects which a CommonJS
20  
-module wants to make available to other modules
21