Commit Graph

33 Commits

Author SHA1 Message Date
Kris Maglione
4dc8a67986 Bug 1317697: Fix handling of more canceled responses. r=mixedpuppy
MozReview-Commit-ID: Axy06zeyPaa
2017-04-06 20:11:54 -07:00
Florian Queze
d3c36892fa Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst
42670ceca0 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Florian Queze
9b4f73599f Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Matthew Wein
18e5cb2f76 Part 1: Bug 1295807 - Add a Javascript Module for registering proxy scripts. r=kmag,robwu
MozReview-Commit-ID: HLokEivMpmp
2017-03-06 17:04:46 -05:00
Ryan VanderMeulen
57a4b61c72 Backed out changeset 7a576717126b (bug 1295807) for unresolved review issues. DONTBUILD 2017-03-06 16:47:49 -05:00
Matthew Wein
4a9f157e28 Part 1: Bug 1295807 - Add a Javascript Module for registering proxy scripts. r=kmag,robwu
MozReview-Commit-ID: HLokEivMpmp
2017-03-03 23:25:57 +00:00
Sebastian Hengst
2d1fc2a660 Backed out changeset 488acde695af (bug 1295807) for formatting failure in extensions-toolkit.manifest and eslint failure. r=backout 2017-03-05 20:18:41 +01:00
Matthew Wein
7c3aae7284 Part 1: Bug 1295807 - Add a Javascript Module for registering proxy scripts. r=kmag,robwu
MozReview-Commit-ID: HLokEivMpmp
2017-03-03 23:25:57 +00:00
Wes Kocher
e992104f74 Backed out 2 changesets (bug 1295807) for build bustage a=backout
Backed out changeset 1b162d4857b5 (bug 1295807)
Backed out changeset 1a9f4c3c782d (bug 1295807)

MozReview-Commit-ID: A7E4wtTcBNM
2017-03-02 18:19:10 -08:00
Matthew Wein
08ecccfcc1 Part 1: Bug 1295807 - Add a Javascript Module for registering proxy scripts. r=kmag,robwu
MozReview-Commit-ID: HLokEivMpmp
2017-03-01 15:35:34 +00: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
14194a39c5 Bug 1260548: Part 8 - Cut down on unnecessary console warnings during test runs. r=aswan
This isn't strictly related to the rest of the changes, but was helpful in the
course of debugging them.

MozReview-Commit-ID: 2nvccYYVXfR
2017-01-29 00:58:25 -08:00
Kris Maglione
bab75b7f08 Add getUniqueId helper function to ExtensionUtils. (no bug) r=me
MozReview-Commit-ID: BXi3Yse5jFt
2016-11-10 21:44:05 -08:00
Sebastian Hengst
4247074d30 Backed out changeset 6790d8962ad9 to make ESlint happy. r=backout 2016-11-12 17:07:10 +01:00
Kris Maglione
1596e24307 Add getUniqueId helper function to ExtensionUtils. (no bug) r=me
MozReview-Commit-ID: BXi3Yse5jFt
2016-11-10 21:44:05 -08:00
Kris Maglione
d71a646d1c Bug 1316396: Part 5 - Move MessageManagerProxy to ExtensionUtils, and add support for proxied listeners. r=aswan
MozReview-Commit-ID: KhinS46k0yW
2016-11-10 10:50:36 -08:00
Kris Maglione
b4842e7473 Bug 1308421: Handle MessageChannel responses correctly after docshells have been swapped. r=aswan
MozReview-Commit-ID: HDTrBfdclXd
2016-10-11 21:08:33 +01:00
Rob Wu
b60b96622e Bug 1302020 - Add filter to Messenger + fix code documentation r=billm
- Make all keys in `filter` mandatory.
- Add `optionalFilter` to Messenger to take over the role of the former
  `filter` parameter.
- Add documentation to Messenger to explain what it really does.
- Fix type comments. Many message message managers were declared as a
  sender, while they are at most a receiver (e.g. `Services.pppm`).

MozReview-Commit-ID: ILDnP2qDIK9
2016-09-11 22:38:40 -07:00
Rob Wu
91820391f9 Bug 1298979 - Add ProxyMessenger, change message managers and getSender r=billm
- Introduce a proxy for IPC messages to allow the following APIs
  to be run out-of-process (ProxyMessenger):

    * runtime.connect
    * runtime.sendMessage
    * tabs.connect
    * tabs.sendMessage
    * runtime.onConnect
    * runtime.onMessage

- Update getSender in ext-tabs, make it independent of the context
  (in particular do not throw an error when a message is received while
  the tab is gone), and move it from MessageChannel to ProxyMessenger to
  make sure that it works in webext-oop. MessageChannel lives in a child
  process, whereas the TabManager (used by getSender) requires data from
  the main process.

- Set the third parameter of `addMessageListener` to true in some places
  to make sure that messages get delivered even after unloading the
  context. This is needed for the next two points.

- Put the `messageManager` property in BaseContext, and let it be set by
  `setContentWindow` - runtime.sendMessage/connect and tabs.sendMessage/
  connect depends on this property, and using the frame message manager
  makes sense.

- Unconditionally use the frame message manager in
  runtime.sendMessage/connect instead of sometimes the cpmm.

MozReview-Commit-ID: 4QkPnlMOkjS
2016-08-25 17:08:08 -07:00
Rob Wu
4ef11b3d36 Bug 1298979 - Use MessageChannel to implement runtime.Port r=billm
- Add new responseType RESPONSE_NONE to MessageChannel to signal no
  expected reply.
- Modify Port to use MessageChannel instead of message managers.
- Include the `port` object to the disconnect event of ports because
  Chrome does it too.
- Replace use of `contentWindow` with `cloneScope` to make the Port
  independent of documents.
- Move registration of context destruction from `api()` to the
  constructor to make sure that the disconnect listener is properly
  removed if for some reason the `api` method is never called.

MozReview-Commit-ID: 9LCo5x1kEbH
2016-08-31 01:08:08 -07:00
Rob Wu
4d5d4452a8 Bug 1286124 - Part 2/2 - Do not deliver messages to the sender's frame r=kmag
MozReview-Commit-ID: 8xZPDIJyMEo
2016-07-13 21:33:56 -07:00
Rob Wu
47e975c1fb 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
2016-08-16 21:36:42 -07:00
Rob Wu
bdf0a6a0a6 Bug 1287626,1288279 - Make IDs unique across processes r=billm
MozReview-Commit-ID: 78xgt8wqbng
2016-08-10 16:23:56 -07:00
Rob Wu
b52f567545 Bug 1286746 - Invoke sendMessage callback even if there are no listeners. r=kmag
MozReview-Commit-ID: HLIC3ZRcwRm
2016-07-14 20:34:40 -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
c19b091a55 Bug 1250784: Part 3 - [webext] Add suport for runtime.openOptionsPage. r=Mossop
MozReview-Commit-ID: 9izx4uX0Szd
2016-03-09 17:10:29 -08:00
Kris Maglione
e0795d5219 Bug 1220154, 1249830: Handle sendMessage replies with 0 and >1 listeners correctly. r=billm
MozReview-Commit-ID: 7lE7RaJcl7n
2016-03-04 15:40:56 -08:00
Kris Maglione
666cee3637 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
Kris Maglione
cb2bf096f9 Bug 1190680: Part 2 - [webext] Add initial support for lastError callbacks. r=billm 2016-01-29 18:38:08 -08:00
Kris Maglione
b0279e6f59 Bug 1210583: Part 1 - [webext] Add support for cross-process messaging with async responses. r=billm 2016-01-27 12:57:21 -08:00