Commit Graph

715 Commits

Author SHA1 Message Date
Kris Maglione
2874f6f820 Bug 1295867: Fix race in handling buffered stderr output from native app. r=me
MozReview-Commit-ID: 14wEDVGlRyb
2016-09-30 00:06:42 +01:00
Kris Maglione
0e8fb15468 Bug 1306037: Support options_ui in embedded WebExtensions. r=aswan
MozReview-Commit-ID: KZVPz52qrTS
2016-09-28 23:11:35 +01:00
Tomislav Jovanovic
32a487cd24 bug 1293355 - add fromCache to onResponseStarted details, r=kmag
MozReview-Commit-ID: GO0a8s8D2oT
2016-09-21 21:57:15 +02:00
Tomislav Jovanovic
4d2be23e86 Bug 1247791 - Implement options.saveAs for downloads.download, r=kmag
MozReview-Commit-ID: 5MrObsL7eTw
2016-09-19 22:39:22 +02: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
Phil Ringnalda
f9b2178711 Backed out changeset 9b6a4552a5c2 (bug 1254221) for test_ext_cookies.html timeouts and lint failures
CLOSED TREE
2016-09-27 18:21:01 -07:00
Jesper Kristensen
69262c1580 Bug 1254221 - Support private browsing cookies in WebExtensions r=kmag
MozReview-Commit-ID: 29ci8wbnMra
2016-05-15 12:18:13 +02:00
Rob Wu
f70a6dfc83 Bug 1296900 - Add test for availability of default WebExtension APIs r=kmag
MozReview-Commit-ID: LIr5Nsv51I3
2016-08-20 22:21:45 -07:00
Wes Kocher
8174fa8630 Backed out 2 changesets (bug 1296900) for mochitest failures in test_ext_all_apis.html a=backout
Backed out changeset c37cf3cfd39c (bug 1296900)
Backed out changeset 998ed8336288 (bug 1296900)
2016-09-23 16:15:05 -07:00
Rob Wu
b90356b171 Bug 1296900 - Add test for availability of default WebExtension APIs r=kmag
MozReview-Commit-ID: LIr5Nsv51I3
2016-08-20 22:21:45 -07:00
Carsten "Tomcat" Book
564bff267b merge mozilla-inbound to mozilla-central a=merge 2016-09-23 12:05:53 +02:00
Ehsan Akhgari
513846c904 Bug 1297687 - Part 3: Ensure that the expanded principal of a sandbox has a sensible OriginAttributes; r=bholley
This patch allows specifying an OriginAttributes when creating a sandbox
using Components.utils.Sandbox() by specifying an originAttributes
member on the options dictionary.

If an OA is specified in this way, it is used for creating codebase
principals from the string arguments passed to the function.  Otherwise,
if one or more principals are passed in the array argument to Sandbox(),
the OA of the principal(s) is used to construct codebase principals from
the strings inside the array.  In this case, we check to make sure that
all of the passed principals have the same OA, otherwise we'll throw an
exception.

In case no explicit OA is specified and no principals are passed in the
array argument, we create the codebase principals using a default OA.
2016-09-22 13:27:51 -04:00
Ehsan Akhgari
0a2b381a4b Bug 1297687 - Part 1: Remove nsIScriptSecurityManager.createExpandedPrincipal(); r=bholley 2016-09-22 13:27:33 -04:00
Bob Silverberg
c49878e5a9 Bug 1299775 - Implement chrome.idle.onStateChanged, r=aswan
MozReview-Commit-ID: 2M5prJYDdqe
2016-09-19 15:44:09 -04:00
Carsten "Tomcat" Book
2dfe81885a merge mozilla-inbound to mozilla-central a=merge 2016-09-22 11:55:12 +02:00
Phil Ringnalda
ca89254357 Backed out 2 changesets (bug 1296900) for est_ext_all_apis.html | failures
Backed out changeset fa509c880990 (bug 1296900)
Backed out changeset 06ee8b3640af (bug 1296900)
2016-09-21 18:59:22 -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
Rob Wu
7536f44a24 Bug 1296900 - Add test for availability of default WebExtension APIs r=kmag
MozReview-Commit-ID: LIr5Nsv51I3
2016-08-20 22:21:45 -07:00
Kris Maglione
bad292d78c Bug 1304331: Support setting the Content-Type header from WebRequest observers. r=mao
MozReview-Commit-ID: 93joPUweJ2x
2016-09-21 14:17:24 +01:00
Carsten "Tomcat" Book
ff5b25e2c0 merge mozilla-inbound to mozilla-central a=merge 2016-09-21 12:03:31 +02:00
Philipp Kewisch
dc8e3f9b36 Bug 1298879 - Upgrade to ESLint 3.5.0 for faster linting. r=miker 2016-09-20 10:27:03 +01:00
Bob Silverberg
1112aa9792 Bug 1280404 - Implement chrome.webNavigation.onTabReplaced, r=aswan
MozReview-Commit-ID: 6K167oHyqz2
2016-09-14 15:57:21 -04:00
Tomislav Jovanovic
dee0f400d7 Bug 1280044 - handle subdirs in browser.downloads filenames, r=aswan
MozReview-Commit-ID: B4WoMbdxYjV
2016-09-09 19:38:01 +02:00
Ben Kelly
ab46e8bcda Bug 1300658 P7 Make test_ext_downloads_search.js wait for full window file removal. r=aswan 2016-09-13 20:14:02 -07:00
Tomislav Jovanovic
1a9e69a168 bug 1288263 - tabs.detectLanguage() returns "und" for undetermined, r=kmag
MozReview-Commit-ID: 72ltWdufHiu
2016-09-10 23:05:02 +02:00
Rob Wu
9cfd0fcca8 Bug 1298979 - move tabs.sendMessage/connect to child process r=billm
- Use the frame's message manager to direct messages via the
  ProxyMessenger to the right tab instead of directly to the tab.
- Put the implementation in a separate file that is only loaded in
  child processes (in the future).
- Explicitly list all addon-process specific files in a new category
  instead of reusing the content one.

MozReview-Commit-ID: 8oIMx9ol7Tl
2016-08-28 20:07:46 -07:00
Rob Wu
e97808b72d Bug 1298979 - Add test to verify that sending a message and unloading works r=billm
Checks what happens before closing a window or removing a frame:

- Tests that sendMessage/connect is received by the extension.
- Tests that any responses from the extension is not received by the
  sending script (of the closing context).

MozReview-Commit-ID: 9VwCpRmaZOO
2016-08-28 16:26:52 -07:00
Rob Wu
e435eadbb2 Bug 1298979 - Check whether ProxyContext exists before using it r=billm
Due to asynchronicity or malice we can receive messages for unknown
ProxyContexts. Immediately reject such messages.

(this addresses https://bugzil.la/1288902#c3)

MozReview-Commit-ID: GEgkZC8CUEG
2016-08-25 19:36:30 -07:00
Rob Wu
41872d2a0a Bug 1298979 - Fix LegacyExtensionContext r=aswan
LegacyExtensionContext should inherit from BaseContext instead of
ExtensionContext, because the latter is moving to a separate process.

Remove the optional `url` parameter because the context is not a frame.
`url` is assigned to `sender.url`, which should only be set for frames.
The sender is only used in extension messaging when `runtime.connect` or
`runtime.sendMessage` are used (where `sender.url` is visible at the
receiver). Since legacy extensions don't send messages, there is no
point at all in setting the `url` value.

MozReview-Commit-ID: FJboNC2SZh0
2016-09-06 01:48:58 -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
b725840b0b Bug 1298979 - Decouple ProxyContext from ExtensionContext r=billm
To allow ExtensionContext to be refactored, we first need to remove the
dependency of ProxyContext on ExtensionContext.

With the decoupling, we can make setContentWindow unconditional and
remove externallyVisible. Let's clean up later.

MozReview-Commit-ID: 1KmSQpxFTVK
2016-08-24 23:29:29 -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
54d9a3f8eb Bug 1298979 - Test sender equality by contextId r=kmag
`this.sender` has a tabId, `sender.tab` has a tab object.  Therefore
they are not equal, and as a result messages were sent to the same
frame. Fixed by relying on contextId, which is unique across processes
since bug 1288279.

MozReview-Commit-ID: 8jMoXiBfp6l
2016-09-06 04:35:35 -07:00
Rob Wu
73fc02545f Bug 1298979 - Properly dispose EventManager r=billm
callbacks is not an array but a Set, and Object.freeze does not prevent
modification of the list/set. Also, merely overwriting the callback set
is not sufficient to prevent callbacks from being run after the context
is closed (`fireWithoutClone`) because the set being iterated is still
filled with callbacks. And keeping the callbacks around may keep strong
references around and hinder GC.

To fix this, the set of callbacks is cleared (which invalidates the
iterator and ends the loop), and register/unregister are nulled.

Also add an explicit check to prevent callbacks from being registered
after unloading a context.

MozReview-Commit-ID: 4i2ojkbYAX9
2016-08-31 01:01:42 -07:00
Bob Silverberg
17f3bb9df7 Bug 1220136 - WebExtensions support chrome.management.uninstallSelf, r=kmag
MozReview-Commit-ID: L80ynbuFr7U
2016-09-07 10:06:01 -04:00
Tomislav Jovanovic
24e5cad3b1 bug 1268399 - add runtime.getBrowserInfo() method with AppInfo data r=kmag
MozReview-Commit-ID: GvwFG0CyfR7
2016-09-04 21:22:18 +02:00
Luca Greco
f580d6bc87 Bug 1252215 - [webext] Fix promiseAddonStartup defined in xpcshell tests. r=kmag
MozReview-Commit-ID: BXYXHDrG6zL
2016-09-01 19:42:41 +02:00
Luca Greco
36fc29ed1f Bug 1252215 - [webext] Add Embedded Extensions helper to LegacyExtensionsUtils. r=aswan,kmag
This patch introduces helper for the embedding of a webextension (and new related tests).

The new exported helpers are going to be integrated in the XPIProvider
to provide the Embedded WebExtension to the Legacy Extensions which
have enabled it in their install.rdf

MozReview-Commit-ID: 7M1DRkXjGat
2016-08-29 15:56:02 +02:00
Luca Greco
ead728d5ad Bug 1252215 - [webext] LegacyExtensionsUtils JSM module and LegacyExtensionContext helper. r=aswan,kmag
- this new module contains helpers to be able to receive connections
  originated from a webextension context from a legacy extension context
  (implemented by the `LegacyExtensionContext` class exported from
  this new jsm module)

- two new test files (an xpcshell-test and a mochitest-browser) ensures that the LegacyExtensionContext can receive a Port
  object and exchange messages with a background page and a content script (the content script test
  is in a different test file because it doesn't currently work on android, because it needs
  the browser.tabs API and the TabManager internal helper)

MozReview-Commit-ID: DS1NTXk0fB6
2016-08-24 18:31:36 +02:00
Phil Ringnalda
5cc38dcb0f Back out 73e11489018d (bug 1220136) for Windows failures in test_ext_management_uninstall_self.js 2016-09-03 11:03:29 -07:00
Bob Silverberg
c100f137d1 Bug 1299846 - Complete the implementation of chrome.idle.queryState, r=kmag
MozReview-Commit-ID: jYsePeTluZ
2016-09-01 09:28:56 -04:00
Bob Silverberg
df4cc09083 Bug 1220136 - WebExtensions support chrome.management.uninstallSelf, r=kmag
MozReview-Commit-ID: L80ynbuFr7U
2016-08-15 15:32:36 -04:00
Kris Maglione
7a7eda1b22 Bug 1298939: Don't register cleanup functions for listeners until the first time they're added. r=rpl
MozReview-Commit-ID: Ai8MxlB2qSb
2016-08-26 16:58:54 -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
Rob Wu
31679e4596 Bug 1298716 - Unify use of ExtensionTestUtils.loadExtension r=billm
MozReview-Commit-ID: DT6rx6KYODl
2016-08-28 17:22:03 -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
Kris Maglione
1b64819992 Bug 1298810: Pass Port object to listeners on native messaging ports. r=rpl
MozReview-Commit-ID: 1saUOB1jyE1
2016-08-29 13:12:16 -07:00
Kris Maglione
b52d0dd49e Bug 1299256: Fix performance issues when stripping comments from large locale files. r=rpl
MozReview-Commit-ID: H7IfBnQ4KnO
2016-08-30 12:24:23 -07:00
Ryan VanderMeulen
7ffccc8668 Merge inbound to m-c. a=merge 2016-08-30 09:52:55 -04:00