This ended up being a bigger change than I had hoped for but
it updates the WebAPITask helper in amWebAPI.js so that errors
returned from the parent process are immediately wrapped into
Error objects from the content page. In this way, programming
errors or other internal errors don't leak out to mozAddonManager
users.
The way the previous code managed window references using "this"
was already a bit fussy, this patch only makes it worse. But I
think this basic logical structure here is right and since this
bug is responsible for widespread breakage, I'd like to get this
checked in and then clean it up in a follow-up.
MozReview-Commit-ID: 98PgbWKsHIN
This adds a bunch of structure supporting a promise-based API on the
AddonManager object that is exposed to webpages and adds the first example,
getAddonByID.
MozReview-Commit-ID: CCEFl4R1o81
Since we want to add a few APIs that AMO can use to query and manipulate the
user's add-ons we want to expose a custom API. This implements the webidl and
a stub implementation in JavaScript. We use the webidl functions for controlling
access to the API, only the AMO production domains (and some test domains when
testing is enabled) can access it and only when retrieved securely and not in
an inner frame of a page that shouldn't have the API.
MozReview-Commit-ID: 3HUUrduuHwf