Commit graph

66 commits

Author SHA1 Message Date
Andrew Swan
c29de224fb Bug 1369577 Part 1 Rename SingletonEventManager to EventManager r=kmag
MozReview-Commit-ID: 7nsYWdSTJCG

--HG--
extra : rebase_source : 7afd89a9a1853d51bd31196bb2faa7e0d786043c
2017-06-09 13:49:07 -07:00
Sebastian Hengst
6d1aee1b24 Backed out changeset 26fd6d0a1254 (bug 1369577) for failing xpcshell's test_ext_simple.js and test_ext_startup_cache.js on Android. r=backout 2017-06-30 01:01:13 +02:00
Andrew Swan
c60b71854e Bug 1369577 Part 1 Rename SingletonEventManager to EventManager r=kmag
MozReview-Commit-ID: 7nsYWdSTJCG

--HG--
extra : rebase_source : 22cf5ee36dfa27e121a5c577bce2fd0189ccb164
2017-06-09 13:49:07 -07:00
Mark Banner
403075400a Bug 1371292 - Clean up more ESLint global definitions in configuration files in toolkit/ and browser/. r=mossop
MozReview-Commit-ID: 5KC23kzaCFN

--HG--
extra : rebase_source : 6a7541b5ffe85d275bc16194c155ad43f93d52ae
2017-06-08 10:59:12 +01:00
Kris Maglione
0cd3e0a862 Bug 1368189: Move more code out of ExtensionUtils.jsm. r=mixedpuppy
Also removes some dead code.

A lot of the code in ExtensionUtils.jsm is not needed in all processes, and a
lot of the rest isn't needed until extension code runs. Most of it winds up
being loaded into all processes way earlier than necessary.

MozReview-Commit-ID: CMRjCPOjRF2

--HG--
extra : rebase_source : 37718eaf05a22b8ccb95f633cf7454bd7975cdce
2017-05-26 15:44:41 -07:00
Kris Maglione
06c9dfdd54 Bug 1368152: Part 4 - Remove ExtensionManagement.jsm. r=aswan
MozReview-Commit-ID: Apbi1QYeb2x

--HG--
extra : rebase_source : 56e223e8ee92c848bbd06d74b1e7dc6d9a01d9e1
2017-06-03 17:18:18 -07:00
Tushar Saini (:shatur)
8bde0a472a Bug 1354590 - Add 'temporary' flag to runtime.onInstalled details. r=aswan,zombie
MozReview-Commit-ID: IbQno1ZL7KV

--HG--
extra : rebase_source : 4229cf4bef0ddb2d17180fb7159111694af4018e
2017-05-14 10:54:11 +05:30
Kris Maglione
6a542a8c05 Bug 1356826: Wait for startup to finish before shutting down. r=me
MozReview-Commit-ID: LksftmZHI8H

--HG--
extra : rebase_source : 6b7a4b9139cafdb0ac42655b7f55f479e187282f
extra : source : 459b36092b7a9e23f35b3ab9856fd8269cdd59b6
2017-05-10 20:26:01 -07:00
Iris Hsiao
6559420d58 Backed out 15 changesets (bug 1358846, bug 1356826) for talos error. a=backout
Backed out changeset 96ea13bb00c5 (bug 1358846)
Backed out changeset b533d7f9b9c2 (bug 1358846)
Backed out changeset 7dcb80a051a3 (bug 1358846)
Backed out changeset 26825f1e33dd (bug 1358846)
Backed out changeset 98b57ff82a54 (bug 1358846)
Backed out changeset b9088593e34f (bug 1358846)
Backed out changeset cb2518673c56 (bug 1358846)
Backed out changeset 889c487a5d41 (bug 1358846)
Backed out changeset 459b36092b7a (bug 1356826)
Backed out changeset c861e23ec8ef (bug 1356826)
Backed out changeset d47998fa24cd (bug 1356826)
Backed out changeset b02e89c67132 (bug 1356826)
Backed out changeset c46fed6e4f6a (bug 1356826)
Backed out changeset 237268e3d9d2 (bug 1356826)
Backed out changeset 527435fc20db (bug 1356826)
2017-05-12 17:45:21 +08:00
Kris Maglione
763a19d302 Bug 1356826: Wait for startup to finish before shutting down. r=me
MozReview-Commit-ID: LksftmZHI8H

--HG--
extra : rebase_source : 7ea6dd9fd4b7448bdc38bf361c3f0fb38df0cafe
2017-05-10 20:26:01 -07:00
Kris Maglione
5e75957ba6 Bug 1356816: Don't load Extension.jsm on startup just to set the browserUpdated flag. r=rhelmer
MozReview-Commit-ID: C0mtHeZ2cJ

--HG--
extra : source : 8eb426870da26be5b86c16a133a11694c17c2843
extra : amend_source : 71d2a6f57591db57df3dfe860d48191c0f3b7cb8
2017-04-15 10:13:39 -07:00
Kris Maglione
b13ea15e1c Bug 1317697: Remove things from ExtensionUtils that don't belong there. r=mixedpuppy
MozReview-Commit-ID: CTX0TckLqoV

--HG--
extra : rebase_source : ebea9b6f0f17a29d331851a08e025cbd04f4d02b
extra : absorb_source : 70b120f39e9307c4b2ef66d8e776e8b832b4aab8
2017-04-07 13:39:06 -07:00
Kris Maglione
bb351ebfca Bug 1350522: Part 2 - Convert toolkit APIs to lazy loading. r=aswan
MozReview-Commit-ID: 8TbTIM4WX2d

--HG--
extra : source : a3ed5ad1bc338e7fd8055c2efcf73695c25e09e5
2017-03-31 19:36:00 -07:00
Tomislav Jovanovic
4faa85e7c9 Bug 1313648 - Add previousVersion to onInstalled details r=aswan
MozReview-Commit-ID: Cmw7zp8CV7e

--HG--
extra : rebase_source : 3a1f10a14015f8acf330350b44855603cd311be5
2017-03-13 05:55:52 +01:00
Andrew Swan
30deceecf8 Bug 1203330 Part 1 Fix SingletonEventManager r=kmag
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.

Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.

Also added a callOnClose for SingletonEventManager when the last listener
is removed.

MozReview-Commit-ID: ATHO97dWf3X

--HG--
extra : rebase_source : bf02d79e3fbab84892be8a7e52ea7a1caf2e003d
2017-01-26 20:00:33 -08:00
Phil Ringnalda
9447dfdbd4 Backed out 3 changesets (bug 1203330) for failures in test_delay_update_webextension.js
CLOSED TREE

Backed out changeset 2d42350d209a (bug 1203330)
Backed out changeset 3a12c51c3eca (bug 1203330)
Backed out changeset 31fac390e15d (bug 1203330)
2017-01-26 19:13:11 -08:00
Andrew Swan
f04f785725 Bug 1203330 Part 1 Fix SingletonEventManager r=kmag
This patch adds the ability to run SingletonEventManager handlers in
different modes: sync, async, raw (no exception handling, arg cloning,
or asynchrony), or asyncWithoutClone. When you call the handler,
you're required to specify which variant you want.

Existing uses of SingletonEventManager are all converted to async calls.
Note that some of them were previously synchronous, but it didn't appear
to be necessary.

Also added a callOnClose for SingletonEventManager when the last listener
is removed.

MozReview-Commit-ID: ATHO97dWf3X

--HG--
extra : rebase_source : 43988ee453e965e1c591b1c64603c22f5a103cff
2017-01-26 13:43:12 -08:00
Matthew Wein
c6cbd23450 Bug 1247435 - Add support for runtime.onStartup r=kmag
MozReview-Commit-ID: F4leEN59vQe

--HG--
rename : toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled.js => toolkit/components/extensions/test/xpcshell/test_ext_runtime_onInstalled_and_onStartup.js
extra : rebase_source : c7eba1d512122dd52b1b4e2b318d6b55ad2c0933
2016-10-19 18:42:27 +01:00
Matthew Wein
5f0528a1ec Bug 1252871 - Add support for runtime.onInstalled r=aswan
MozReview-Commit-ID: 3wDtv0g0BpO

--HG--
extra : rebase_source : c5d50e41e4cf241b2c3d021e8c2283d4251b7118
2016-10-19 10:38:29 +01:00
Wes Kocher
77f03518da Backed out 3 changesets (bug 1252871) for test_ext_all_apis.html bustage a=backout CLOSED TREE
Backed out changeset b3a08a040c8a (bug 1252871)
Backed out changeset c2a511511a72 (bug 1252871)
Backed out changeset 9c2c3780aa4c (bug 1252871)
2016-10-28 14:24:13 -07:00
Rob Wu
0f0355e922 Bug 1299411 - Move native messaging to child process r=kmag
Move `runtime.connectNative` and `runtime.sendNativeMessage` to
`addon_child`. Note: This does not change the behavior for launching the
native app, it is still launched from the main process.

Now ExtensionUtils's Port is also used for native messaging ports. Now
the behavior of `runtime.connect` and `runtime.connectNative` are
identical from the extension's perspective.
In particular:
- `disconnect()` does not throw when called again (bug 1287229).
- `onDisconnect` is called with error messages (tests will be added in
  the next commit).

MozReview-Commit-ID: AyU9amiLeoL

--HG--
extra : rebase_source : be44523ca1b6555f5c356f12790c896e781d809f
2016-09-24 13:25:56 +02:00
Rob Wu
edfaa70caa Bug 1299411 - Remove extension param from NativeApp r=aswan
The extension is always available as `context.extension`, so do not
unnecessarily pass the extension as a separate parameter.

MozReview-Commit-ID: 9OaestUAGVk

--HG--
extra : rebase_source : b1f408d3750152477195655c5a777e1ff4682a09
2016-09-24 13:18:48 +02:00
Rob Wu
cce894192b Bug 1299411 - separate serialization from sending r=aswan
Serialization of the message should happen in the same process as the
extension context, whereas sending the message should be in the same
process as the owner of the native messaging host.
With webext-oop, the former is an addon process and the latter the
main process. Therefore it is necessary to separate the two roles.

MozReview-Commit-ID: 8BJZmn2QjLJ

--HG--
extra : rebase_source : d0665885c304b45c2f44e82f29c1a8260fe454c5
2016-09-24 13:03:20 +02:00
Matthew Wein
20342b5f6c Bug 1252871 - Add support for runtime.onInstalled r=aswan
MozReview-Commit-ID: 3wDtv0g0BpO

--HG--
extra : rebase_source : 589f77f750d7d874cb8f1634590b944b366fb3a4
2016-10-19 10:38:29 +01:00
Tomislav Jovanovic
458e517f19 bug 1268399 - add runtime.getBrowserInfo() method with AppInfo data r=kmag
MozReview-Commit-ID: GvwFG0CyfR7

--HG--
extra : rebase_source : 0dc021313cc14bd145fd92966abd230340b8dca5
2016-09-04 21:22:18 +02:00
Rob Wu
cf5257b11d Bug 1287010, 1286712 - Use schema-generated runtime API, split ext-runtime.js r=billm
- Use schema-generated runtime API for content scripts instead of
  untyped API.
- Move logic that cannot be run in the main process to a new file.

Together with the previous patch that migrated the i18n API, this
concludes the fix for bug 1286712.

MozReview-Commit-ID: A3yG0x1kjwx

--HG--
extra : rebase_source : 19efe95149c423c0f9284bb70e289a282fb758c1
2016-08-18 18:15:37 -07:00
Rob Wu
be3652cd57 Bug 1287010 - Make environment of Context explicit. r=billm
- Add `envType` to BaseContext.
 - Pass an explicit envType to all `registerSchemaAPI` invocations.
 - The factories passed to `registerSchemaAPI` will be split up later, so
   that content scripts (`content_child`) and addon pages can share
   common implementations.
 - The factories that implement the addon API will also be split up,
   to separate code running in the main process (`addon_parent`) from
   code running in a child process (`addon_child`).
 - Remove the use of a hardcoded list of `namespaces` from ProxyContext.
   Now `envType` is used to specify whether an API should be activated.

MozReview-Commit-ID: Jiff8HIwG92

--HG--
extra : rebase_source : 946a3c0009a4e3223c2d10044b3099a94c845394
2016-08-16 15:51:50 -07:00
Rob Wu
53ae1a1256 Bug 1286712 - Validate runtime.sendMessage parameters r=billm
The main motive for this patch is to remove the use of the GlobalManager
global (which was used to see if an extension ID is valid, which was
specifically added in order to create thebrowser_ext_lastError.js test).
To preserve test coverage I implemented a full validation of the
runtime.sendMessage method.

Now the error for a non-existent extension is identical in both the
content script and background pages. Note that this also fixes a
minor privacy leak: Previously extensions could see whether another
extension is installed by sending a message to the specified extension
and using the different responses to see whether another extension is
installed.

MozReview-Commit-ID: 82R97Ei25Xr

--HG--
extra : rebase_source : 900a65e695afd6db83d5102f515dc29d46d001f1
2016-08-16 21:36:42 -07:00
Rob Wu
3451c2f756 Bug 1295082 - BaseContext.extensionId -> BaseContext.extension.id r=kmag
MozReview-Commit-ID: 2tFVUwjyJQu

--HG--
extra : rebase_source : 07ea6252ab49d992ff17db77dea5840732f478c4
2016-08-16 14:29:52 -07:00
Rob Wu
bacc209644 Bug 1295082 - Put Extension in BaseContext r=kmag
ExtensionContext in Extension.jsm has |extension| as an instance member,
so use it instead of passing |extension| to registerSchemaAPI's
callback.

And to make sure that this pattern also works in content processes, move
the |extension| member to BaseContext.

MozReview-Commit-ID: BgsGGCPQxJR

--HG--
extra : rebase_source : 7aa9fb7a53e057e8d3d8c477bd6821f8344c571a
2016-08-15 01:04:58 -07:00
Sebastian Hengst
2164cd95c8 Backed out changeset 0ce1cc39aa3d (bug 1295082) for timing out in test_ext_schemas_api_injection.js. r=backout 2016-08-18 16:47:09 +02:00
Sebastian Hengst
3b39ae834c Backed out changeset dc7b09331202 (bug 1295082) 2016-08-18 16:46:30 +02:00
Rob Wu
62ec179344 Bug 1295082 - BaseContext.extensionId -> BaseContext.extension.id r=kmag
MozReview-Commit-ID: 2tFVUwjyJQu

--HG--
extra : rebase_source : 7091f5f8f52b158912fb503626a20d82db2142f8
2016-08-16 14:29:52 -07:00
Rob Wu
dfc11d6f00 Bug 1295082 - Put Extension in BaseContext r=kmag
ExtensionContext in Extension.jsm has |extension| as an instance member,
so use it instead of passing |extension| to registerSchemaAPI's
callback.

And to make sure that this pattern also works in content processes, move
the |extension| member to BaseContext.

MozReview-Commit-ID: BgsGGCPQxJR

--HG--
extra : rebase_source : 9a85d95f0c147198938b86c57127f6e7403fd53c
2016-08-15 01:04:58 -07:00
Robert Helmer
bcf92a01fd Bug 1279012 - implement onUpdateAvailable and runtime.reload() for WebExtensions r=aswan
MozReview-Commit-ID: KywrVkcRhzp

--HG--
extra : rebase_source : e51f67f76f3b3ac845b2d2f3ba8c36005c43c2c1
2016-08-02 09:37:01 -07:00
Andrew Swan
1eac929388 Bug 1270360 Implement runtime.sendNativeMessage() r=kmag
MozReview-Commit-ID: 93FaGaYto5w

--HG--
extra : rebase_source : 520ff9d6bb6c8d9262c87103090236fcf1923b49
2016-06-08 14:52:35 -07:00
Kris Maglione
a1dac7caad Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS

--HG--
extra : source : a00cf073f5c00380d4e42b13bc0cd3146b708845
extra : amend_source : d74ef90e88acbe62e33af3b5b9cf870d5c0a9d3e
2016-06-09 17:44:47 -07:00
Sebastian Hengst
f8035f62a8 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
b465305345 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS

--HG--
extra : rebase_source : cba877c0ef400917b0b7e5913895e64ebefb34b9
extra : amend_source : 6e943015e3e00854c431cbd653994a6734e66ce4
2016-06-09 17:44:47 -07:00
Andrew Swan
80434719cd Bug 1270357 Implement runtime.connectNative() r=kmag
MozReview-Commit-ID: Fo4BxEo3xus

--HG--
extra : rebase_source : 7fb28ebb89474c2f65bf844b3337fd2906cd0ad3
2016-06-08 20:23:40 -07:00
Phil Ringnalda
8d1174f9a3 Back out 3 changesets (bug 1270357) for test_chrome_ext_native_messaging.html timeouts
CLOSED TREE

Backed out changeset 2e602689376d (bug 1270357)
Backed out changeset e1979d928c7c (bug 1270357)
Backed out changeset e0f9b54febc8 (bug 1270357)
2016-06-08 20:35:32 -07:00
Andrew Swan
68dfb9f08d Bug 1270357 Implement runtime.connectNative() r=kmag
MozReview-Commit-ID: Fo4BxEo3xus

--HG--
extra : rebase_source : 069f9b25d13db2c8cd8a3a4199391e5fad68104d
2016-06-08 13:51:01 -07:00
Kris Maglione
128a5928cb Bug 1250784: Part 3 - [webext] Add suport for runtime.openOptionsPage. r=Mossop
MozReview-Commit-ID: 9izx4uX0Szd

--HG--
extra : rebase_source : d474f77b37007f8b7e3118781af4b3d8d64aac61
2016-03-09 17:10:29 -08:00
Matthew Wein
e82011511c Bug 1246031 - Utility for obtaining platform information. r=kmag 2016-02-17 15:14:28 -05:00
Kris Maglione
ba2e5f60f4 Bug 1248855 - [webext] Add "object-curly-spacing" ESLint rule and auto-fix errors. r=billm
MozReview-Commit-ID: BAZ2rRl7eSM
2016-02-16 20:10:00 -08:00
Andrew Swan
c28e53d13a Bug 1156826 - Implement browser.runtime.setUninstallURL(). r=kmag 2016-02-08 16:00:25 -08:00
Kris Maglione
16dd4dca4d Bug 1234020: Part 2d - [webext] Return promises from the runtime API. r=rpl
--HG--
extra : commitid : HE3oP4KrWNU
extra : rebase_source : d07143c93e2792114f6ee4128fc28ef41a60b8a0
2016-02-01 18:08:18 -08:00
Kris Maglione
e391b5ccaf Bug 1190680: Part 2 - [webext] Add initial support for lastError callbacks. r=billm
--HG--
extra : commitid : KyImBk4vvCu
extra : rebase_source : f05432e862480ca7e4c81c9fd663822bba63c7af
extra : histedit_source : 6cec5cd0c0c4986f0b22e4338b2e6da3cb851ef7
2016-01-29 18:38:08 -08:00
Bill McCloskey
b8196d4c71 Bug 1208257 - [webext] runtime.json (r=kmag) 2015-12-23 08:57:13 -08:00
Kris Maglione
b729a30707 Bug 1229874: Part 3 - Enable ESLint in WebExtension code. r=billm
The base .eslintrc is essentially a merge of the root Toolkit .eslintrc and
the devtools .eslintrc, with some minor changes to match our prevalent style.

For the most enforces the coding styles that we've been using most
consistently. There are a couple of significant differences, though:

 * The rule for opening brace alignment can only be applied globally, and
   doesn't make exceptions for top-level functions. I chose to turn it on, and
   change the brace style of existing top-level functions that violated it,
   since the rule seemed worth using, and that's the direction most Toolkit JS
   code has been headed anyway.

 * The rule for switch/case statements requires an added indentation level for
   case statements. Most of our switch statements did not use an extra level
   of indentation, and I initially wrote the rule to enforce that style, until
   I came across case statements that used blocks, and required the extra
   indentation level for sanity.

--HG--
rename : devtools/.eslintrc => toolkit/components/extensions/.eslintrc
extra : commitid : 4aDZOi5MNPc
extra : rebase_source : f34ba43aeb8046a0c971cb76b76410497bd12b42
extra : source : 2a7eb4ef7b375e5fd52d843ca206a071367a6475
2015-12-02 16:58:53 -08:00