Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 67 lines (47 sloc) 2.532 kB
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
1 This is an addon that allows for integration between Firefox and
c9abf45 @toolness Origination, moved from http://hg.mozilla.org/users/avarma_mozilla.co…
toolness authored
2 the Mozilla Add-ons Builder (formerly known as FlightDeck).
24a4993 @toolness Added TODOs to README.md
toolness authored
3
a59851a @toolness updated TODOs in readme, added usage section.
toolness authored
4 ## Usage ##
5
d4a42c7 @toolness added docs for pref.
toolness authored
6 1. If necessary, either edit the file `data/addon-config.json` so that
7 it contains the URL(s) for origins that host the Mozilla Add-ons
8 Builder or set the `extensions.addonBuilderHelper.trustedOrigins`
9 preference in `about:config` to a comma-delimited list of
10 origins. The scheme, host, and port of each URL make up its
11 "origin", meaning that the rest of the URL will be ignored when
12 making trust decisions.
a59851a @toolness updated TODOs in readme, added usage section.
toolness authored
13
14 2. All pages under a trusted origin will automatically have a
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
15 `mozFlightDeck` object added to their `window`
16 object. See below for its API.
17
a9a3ffe @toolness added docs for addonbuilderhelperstart event to README.md.
toolness authored
18 3. As soon as the addon is activated, an event of type
19 `addonbuilderhelperstart` will be dispatched to the
20 `document.body` element of every open tab.
21
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
22 ## API ##
23
37b1082 @ochameau Refactor helper in order to work with new loader released in SDK 1.4.
ochameau authored
24 <tt>var promise = window.mozFlightDeck.**send**(*command*, ...)</tt>
25 <tt>promise.**then**(function (*response*) { ... })</tt>
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
26
37b1082 @ochameau Refactor helper in order to work with new loader released in SDK 1.4.
ochameau authored
27 Sends a command request to the addon, with first argument being the command
28 name, then optional arguments specific to each command. These arguments
29 need to be JSON-able objects. This `send` method returns a
30 `response` object through a promise pattern.
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
31
32 `response` has at least one boolean property,
33 `response.success`, indicating whether the command executed
6389769 @toolness Added to README.md.
toolness authored
34 successfully. If it is `false`, then `response.msg`
35 is a string explaining why.
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
36
6389769 @toolness Added to README.md.
toolness authored
37 Valid command strings are:
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
38
37b1082 @ochameau Refactor helper in order to work with new loader released in SDK 1.4.
ochameau authored
39 * `version` - Queries addon builder helper addon version, placing the
40 integer result in `response.msg`.
41
42 * `toggleConsole` - Toggle visiblity of the XUL JS Console.
43
44 * `isInstalled` - Queries if an addon is currently installed,
45 placing the boolean result in `response.isInstalled`.
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
46
37b1082 @ochameau Refactor helper in order to work with new loader released in SDK 1.4.
ochameau authored
47 * `uninstall` - If an addon is currently installed, uninstalls it.
48 If no addon is currently installed, this command does nothing.
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
49
37b1082 @ochameau Refactor helper in order to work with new loader released in SDK 1.4.
ochameau authored
50 * `install` - Installs an addon, uninstalling any predecessor.
51 `obj.contents` must be a string representing binary XPI data;
52 due to bug 541828, corrupt values can actually crash some versions
53 of Firefox, so be careful!
47ffabb @toolness made API for window.mozFlightDeck more consistent and documented it.
toolness authored
54
a59851a @toolness updated TODOs in readme, added usage section.
toolness authored
55
934c189 @toolness Removed final TODO, added Limitations section to replace it.
toolness authored
56 ## Limitations ##
24a4993 @toolness Added TODOs to README.md
toolness authored
57
934c189 @toolness Removed final TODO, added Limitations section to replace it.
toolness authored
58 Haven't yet made Bugzilla bugs for these.
59
241cfcf @toolness Changed limitations section to reflect current code.
toolness authored
60 * The Addon Builder Helper doesn't currently deal well with the case
61 where addons raise exceptions while being installed or uninstalled
62 in development mode.
934c189 @toolness Removed final TODO, added Limitations section to replace it.
toolness authored
63
64 * If the user has an addon installed via the Firefox Addon Manager
65 and then tries installing the same addon in development mode
66 using the Addon Builder Helper, an explosion occurs.
Something went wrong with that request. Please try again.