Commit Graph

80 Commits

Author SHA1 Message Date
Kris Maglione
bdb8ae3dfd Bug 1317697: Split ExtensionContent.jsm into a stub process script. r=mixedpuppy
MozReview-Commit-ID: 4vn0ERZiBQd
2017-04-14 17:00:51 -07:00
Kris Maglione
bb59598fb0 Bug 1317697: Lazily initialize Schemas.jsm. r=mixedpuppy
MozReview-Commit-ID: 83pKM6lLsra
2017-04-06 20:14:24 -07:00
Kris Maglione
65308c79f2 Bug 1354941: Pre-load all cached schema data in one DB operation. r=aswan
MozReview-Commit-ID: JyBOcR2Ea15
2017-04-11 16:08:45 -07:00
Andrew McCreight
b61e2fe0bb Bug 1353081 - Lazily load NetUtil.jsm in Schemas.jsm. r=kmag
MozReview-Commit-ID: 3tgBGo6KxV1
2017-04-03 10:22:54 -07:00
Kris Maglione
115e1d5fce Bug 1344590: Part 4 - Store parsed and normalized extension data in indexedDB. r=aswan
MozReview-Commit-ID: HA0PJfbGa9w
2017-03-08 09:16:01 -08:00
Kris Maglione
eac9f51bfd Bug 1344590: Part 3 - Handle schema default values for object properties. r=aswan
MozReview-Commit-ID: 6rzMwvRl4ho
2017-03-07 23:04:36 -08:00
Kris Maglione
9ac789da88 Bug 1333477: Part 3 - Support dynamically injecting and revoking schema properties based on permissions. r=aswan
MozReview-Commit-ID: C2pQpsD18W0
2017-03-04 16:43:21 -08:00
Kris Maglione
adec8be422 Bug 1333477: Part 1 - Bail out earlier for unsupported schema entries. r=aswan
MozReview-Commit-ID: KLxBj1my5bT
2017-03-04 16:47:49 -08:00
Bob Silverberg
a8478b79ad Bug 1312802 - Implement chrome.privacy API, r=aswan
MozReview-Commit-ID: 5DoGnYb945Z
2017-02-15 17:32:24 -05:00
Kris Maglione
04c93fc6ca Bug 1339144 - Use windowless browser for remote background pages. r=aswan
MozReview-Commit-ID: LfmPbkTsgwu
2017-02-16 17:26:15 -08:00
Iris Hsiao
a03d2f9e7d Backed out changeset c122b0183c7c (bug 1339144) for xpcshell failures 2017-02-17 10:40:20 +08:00
Kris Maglione
04eaecabfd Bug 1339144 - Use windowless browser for remote background pages. r=aswan
MozReview-Commit-ID: LfmPbkTsgwu
2017-02-16 17:26:15 -08:00
Kris Maglione
18320a2864 Bug 1338409: Part 2 - Lazily parse the schema data for each namespace property, as it is needed. r=aswan
MozReview-Commit-ID: FNQJdt6BnjI
2017-02-09 18:59:49 -08:00
Kris Maglione
8ab50cf4da Bug 1338409: Part 1 - Lazily parse the schema data for each namespace as it is needed. r=aswan
MozReview-Commit-ID: 73q9ba9sLtb
2017-02-10 21:06:55 -08:00
Jared Wein
21fc75d491 Bug 1326479 - Fix 'indent' eslint errors now that eslint scans multiline array and object definitions. r=Gijs
MozReview-Commit-ID: 99mWjxu8PPn
2017-01-03 10:07:50 -05:00
Kris Maglione
01bbe49261 Bug 1315872: Add browser.test.assertRejects and assertThrows. r=aswan
MozReview-Commit-ID: DKUlSVS2EvA
2016-11-07 22:03:15 -08:00
Kris Maglione
569fb0cb43 Bug 1315575: Part 3 - Convert ImageData objects at the binding layer, and remove unnecessary content bindings. r=aswan
MozReview-Commit-ID: CjqXRiFcMWp
2016-11-06 17:35:07 -08:00
Kris Maglione
cdaccd617b Bug 1312690: Lazily initialize binding implementation objects. r=aswan
MozReview-Commit-ID: E8K6In6JtWO
2016-10-30 20:24:12 -07:00
Kris Maglione
e10c4436dc Bug 1312690: Lazily initialize schema bindings. r=aswan
MozReview-Commit-ID: GoVUlANCgHg
2016-11-02 19:09:04 -07:00
Rob Wu
9ebbb4a33c Bug 1287007 - Fix "onclick" in contextMenus, to child. r=billm
Main thing: Making contextMenus implementation webext-oop compatible.

Preparation:

- Add getParentEvent to ChildAPIManager to allow use of remote events.
- Introduce `addon_parent_only` to "allowedContexts" to only generate a
  schema API in the main process.
- Do not fill in `null` for missing keys if the schema declares a key as
  `"optional": "omit-key-if-missing"`. This is needed for the second
  point in the next list.

Drive-by fixes:

- Ensure that the "onclick" handler is erased when a context closes.
- Do not clear the "onclick" handler in `contextMenus.update` if the
  onclick key has been omitted (parity with Chrome).
- Remove some unnecessary `Promise.resolve()`
- Add extensive set of tests that check the behavior of the contextMenus
  APIs with regards to the onclick attribute in various scenarios.

MozReview-Commit-ID: A5f3AUQzU8T
2016-09-12 18:26:03 -07:00
Rob Wu
58cc11a650 Bug 1287007 - Require "async" in schemas to match name r=billm
In the pageAction and browserAction schemas, several methods are
declared with `"async": true` but without a specified callback in the
`"parameters"` object, so callbacks are not allowed. However, when a
callback is proxied, the `ParentAPIManager` will mirror the call by
passing in an extra callback to the proxied API - and break.

This patch fixes the issue by removing uses of async:true.  Also for
consistency between the browserAction and pageAction methods, the
methods that were not declared as async have also been marked as async.

MozReview-Commit-ID: JQqzmTUAotB
2016-09-02 03:37:55 -07:00
Bob Silverberg
e488505140 Bug 1262250 - Add a defaultValue property to the web extension schema, r=aswan
MozReview-Commit-ID: 175Nxr39NKw
2016-10-03 14:55:17 -04:00
Alexandre Poirot
27c0d33718 Bug 1290581 - Improve error message from Extension.jsm and Schemas.jsm's readJSON functions. r=rpl
MozReview-Commit-ID: 8O5OIk4IdYM
2016-10-03 09:38:52 -07:00
Matthew Wein
c26b978847 Bug 1302898 - Rename 'restrictions' to 'allowedContexts' r=kmag
All tests pass locally.

MozReview-Commit-ID: 5dPPthlPT6i
2016-09-19 17:36:46 -07:00
Matthew Wein
fec69037f1 Bug 1302898 - Make the schema restrictions array non-nullable. r=kmag
MozReview-Commit-ID: Lk8TGsqC4WC
2016-09-14 17:02:06 -07:00
Kris Maglione
31297b2525 Bug 1298939: Don't initialize APIs that the extension does not have permissions for. r=rpl
MozReview-Commit-ID: Y0MTBL1z2O
2016-09-01 13:04:54 -07:00
Kris Maglione
386a89d124 Bug 1265371: Refactor schema parsing to reduce cyclomatic complexity. r=bsilverberg
MozReview-Commit-ID: HzVrf4yG7hZ
2016-08-30 12:24:32 -07:00
Rob Wu
becfb68e93 Bug 1287010 - Refactor shouldInject / pathObj r=billm
Split the `shouldInject` method into separate methods:
- `shouldInject` to determine whether the API (or namespace)
  should be injected.
- `getImplementation` to return the actual implementation.

Introduced `SchemaAPIInterface` for documentation purposes, and
two concrete implementations `LocalAPIImplementation` and
`ProxyAPIImplementation` which provide the functionality to run a local
and remote implementation of the API for which the schema API is
generated, respectively. These classes store the necessary details for
the invocation, so the methods that were formerly in the `Context` in
Schemas.jsm no longer get the `pathObj`, `path` or `name` parameters.

And merge the `path` and `name` in the implementation of remote APIs
because there is no need for having them separate, as the callers and
callees often did redundant pre/post-processing on `data.path` because
of the way it was implemented.

MozReview-Commit-ID: isbG9i9pNP
2016-08-24 01:03:49 -07:00
Rob Wu
fc61c013eb Bug 1287010 - Prepare for moving content script APIs to schemas r=billm
- By default, schema APIs are not injected in content scripts unless
  the JSON schema sets the "restrictions" attribute to `["content"]`.
- Added the "restrictions" attribute to the storage and test schemas.
  Other APIs will follow in subsequent commits and make use of the
  primitives introduced in this commit.

MozReview-Commit-ID: 1rNjQap0BiM
2016-08-18 17:46:57 -07:00
Rob Wu
42e49c6137 Bug 1287010 - Add pathObj parameter to Schemas r=billm
Local wrappers currently look up the API object over and over again
whenever a schema API is invoked. This can be optimized by re-using
the lookup result from a `shouldInject` invocation, which is passed
as the `pathObj` parameter to the wrapper methods.

This commit adds the necessary changes and tests to allow this to
happen, but does not modify the wrapper in Extension.jsm yet.

Also, this construction allows the `ChildAPIManager` to use a local
implementation if available and fall back to a remote implementation
otherwise.

MozReview-Commit-ID: C9gm7A9Zppb
2016-08-19 00:35:07 -07:00
Rob Wu
52997a1c5a Bug 1297202 - Support cross-namespace submodule references in schemas r=aswan
MozReview-Commit-ID: 5JfOI3i3xbW
2016-08-22 15:11:47 -07:00
Rob Wu
b37ee71c9a Bug 1293132 - Document and enforce contract for Schemas.inject and Schemas.normalize r=kmag
MozReview-Commit-ID: KgSrgHttwrI
2016-08-07 18:36:36 -07:00
Sebastian Hengst
4efcf6be95 Backed out changeset d71c400313a2 (bug 1293132) for failing test_ext_schemas_api_injection.js on Android's Sets test. r=backout 2016-08-18 18:27:34 +02:00
Rob Wu
cfcfbf0fa2 Bug 1293132 - Document contract for Schemas.inject and Schemas.normalize r=kmag
MozReview-Commit-ID: KgSrgHttwrI
2016-08-07 18:36:36 -07:00
Rob Wu
5d41ba7ac3 Bug 1295473 - Fix return type of {tabs,runtime}.sendMessage r=billm
The tabs.sendMessage and runtime.sendMessage implementations behave like
an async function: They take a callback parameter and return a promise.
So they should be handled by |callAsyncFunction|, not
|callFunctionNoReturn|.

This fixes the issue for background pages, but not for content scripts
because sendMessage is not implemented as a schema at the moment. This
will also be fixed once content script APIs are generated via Schemas.

MozReview-Commit-ID: 9p1hvOP0KSm
2016-08-15 23:53:24 -07:00
Luca Greco
248525c5e7 Bug 1290901 - [webext] Allow "events" and "properties" in SubModuleType defined in JSON schema. r=aswan
MozReview-Commit-ID: Pd0pMu2VB0
2016-07-21 17:20:25 +02:00
Luca Greco
c2292f3b1f Bug 1290901 - [webext] Handle nested namespaced API schema. r=aswan
MozReview-Commit-ID: H26E8ZwLrqJ
2016-08-15 15:34:43 +02:00
Kris Maglione
aeb04c78d9 Bug 1263011: Part 2 - Implement WebExtensions Experiments prototype. r=aswan
MozReview-Commit-ID: 4KO4cCLRsLf
2016-08-05 14:20:54 -07:00
Jared Wein
ebf1ccbe46 Bug 1291855 - Enable the no-else-return rule for eslint. r=Felipe,kmag,mossop
MozReview-Commit-ID: DYOmE6xwMJh
2016-08-03 18:54:59 -04:00
Matthew Wein
e3d00b8074 Bug 1285063 - Part 2: Switch to using the Category Manager to register scripts/schemas in order to load them in time for Fennec. r=kmag
MozReview-Commit-ID: 2U8cTYeH8kg
2016-07-22 12:44:40 -07:00
Matthew Wein
6206634766 Bug 1270742 - Add support for default_icon in chrome.pageAction r=kmag
MozReview-Commit-ID: D9uR0JUXJwx
2016-05-23 15:59:33 -07:00
Sebastian Hengst
1be0f90cda Backed out changeset 1008f5b88e6b (bug 1270742) for failing browser_ext_browserAction_context.js. r=backout 2016-06-24 13:00:31 +02:00
Matthew Wein
0ead67a3c6 Bug 1270742 - Add support for default_icon in chrome.pageAction. r=kmag
MozReview-Commit-ID: D9uR0JUXJwx
2016-05-23 15:59:33 -07:00
Martin Giger
fccc9c078a Bug 1279562 - Accept negative 'left' and 'top' values in chrome.windows.update. r=kmag 2016-06-17 02:22:00 -04:00
Kris Maglione
843973aa31 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS
2016-06-09 17:44:47 -07:00
Sebastian Hengst
d97f588f03 Backed out changeset a00cf073f5c0 (bug 1279392) for failing mochitest test_ext_contentscript_create_iframe.html at least on Linux x64 opt. r=backout 2016-06-14 13:37:52 +02:00
Kris Maglione
b2a33e3bf1 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS
2016-06-09 17:44:47 -07:00
Kris Maglione
975a0065a1 Bug 1271785: [webext] Better error messages for "choices" schema types. r=aswan
The generated messages are still a bit rough in some instances, but they're at
least much better than what we have now.

MozReview-Commit-ID: gTS0RvDnwk
2016-06-04 23:31:35 -07:00
Kris Maglione
4a1342c9e6 Bug 1278733: Turn on JSDoc validation, and fix basic errors in existing comments. r=aswan
MozReview-Commit-ID: EZpOyvoi2h0
2016-06-07 18:36:19 -07:00
Kris Maglione
f61f60b7e6 Bug 1254194: [webext] Allow extensions to register custom content security policies. r=billm f=aswan
MozReview-Commit-ID: 8L6ZsyDjIpf
2016-04-23 21:29:15 -07:00