Commit Graph

1180 Commits

Author SHA1 Message Date
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
Rob Wu
36055ef9cc Bug 1296900 - Hide commands API if manifest key is missing r=kmag
MozReview-Commit-ID: 7vld6MgSlqG
2016-08-20 23:01:43 -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
Jared Wein
b6817d7876 Bug 1315781 - Enable no-shadow rule for eslint for xpcshell mochitests. r=mossop
MozReview-Commit-ID: 1mhCWplknyN
2016-11-07 22:34:25 -05:00
Iris Hsiao
d24e67dbe4 Backed out changeset f6f28be8d8f2 (bug 1315781) for XPCShell test timed out 2016-11-10 14:53:46 +08:00
Jared Wein
0c41af265f Bug 1315781 - Enable no-shadow rule for eslint for xpcshell mochitests. r=mossop
MozReview-Commit-ID: DnpVQRrG9Ec
2016-11-07 22:34:25 -05:00
Kris Maglione
0bbe39a4f0 Bug 1322869: Part 2 - Memoize some relatively expensive-to-compute tab attributes. r=bsilverberg
MozReview-Commit-ID: EpjsLhlNzvG
2016-12-19 12:34:50 -08:00
Kris Maglione
1f770639ea Bug 1322869: Part 1 - Apply window filters per-window rather than per-tab. r=bsilverberg
MozReview-Commit-ID: AAlyBJowMOm
2016-12-19 12:34:09 -08:00
Kanika Narang
7172a05279 Bug 1302950 - Rename --panel-arrowcontent* CSS variables to --arrowpanel*. r=dao 2016-09-20 09:27:49 +02:00
Sebastian Hengst
0a57070d7e Backed out changeset 752f33561e8f (bug 1302950) for failing browser-chrome test browser_ext_popup_background.js. r=backout 2016-09-17 14:49:50 +02:00
Kanika Narang
1dab229a50 Bug 1302950 - Rename --panel-arrowcontent* CSS variables to --arrowpanel*. r=dao 2016-09-17 12:17:04 +02:00
Greg Tatum
0fc28c2ff3 Bug 1290988 - Collect devtools/shared/css-* files into a folder. r=tromey
In preparation for the additional files in the `mach generate-css-db`
command, collect the CSS files into a folder.

MozReview-Commit-ID: 9JRVsC2NMK8
2016-09-14 10:00:27 -05:00
Matthew Wein
8a5b1d5dfa Bug 1245346 - Add test for onUpdated while lacking tab permissions. r=kmag
MozReview-Commit-ID: EZysUdjnSJK
2016-04-19 20:13:08 -04: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
0734f28b64 Bug 1241719 - Fix intermittent browser_ext_tabs_onUpdated.js r=kmag
MozReview-Commit-ID: LhHS6F0YFUJ
2016-09-10 03:16:39 -07: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
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
e966600a6c Bug 1300883 - Use changeInfo.status instead of tab.status in browser_ext_tabs_events.js r=kmag
the tabs.onUpdated event can fire for many reasons.
I observed a test failure because a faviconUrl change triggered the
onUpdated event, which caused on-updated-dims to be sent too early.

MozReview-Commit-ID: 8YT8hSXnIoo
2016-09-06 13:22:11 -07:00
Bob Silverberg
5311746971 Bug 1272676 - Remove HistoryTime and use Date type instead, r=aswan
MozReview-Commit-ID: IqH2eLJwn5d
2016-09-06 12:56:56 -04: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
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
Wes Kocher
e13f8b0cdf Merge m-c to inbound, a=merge 2016-08-25 17:14:17 -07:00
Kris Maglione
c6c89fc38c Bug 1293287: Close extension popups on extension shutdown. r=aswan
MozReview-Commit-ID: 5lpIk6XrdOM
2016-08-24 16:26:35 -07:00
Rob Wu
a430263825 Bug 1287010 - Use sandbox instead of JSM for global separation r=billm
MozReview-Commit-ID: GSqmh0xC2hW
2016-08-23 16:19:33 -07:00
Rob Wu
812e170fe8 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
2016-08-16 15:51:50 -07:00
Rob Wu
a68fdede92 Bug 1287010 - Use minimal global scope for ext-*.js scripts r=billm
Currently there is a tight coupling between registered APIs because they
share the same global scope, and the dependencies between the modules
that use these globals are not explicit. Consequently, it would be
possible for APIs to break when the registered APIs run in separate
processes, because then there are separate global scopes.
To mitigate this issue, this patch isolates the global namespaces of
API registrations in different environments, starting with the "chrome"
process. Content and addon processes will follow later.

A new JSM is introduced to avoid hidden dependencies between ext-*.js
and the script loader. ExtensionUtils.jsm would be a natural choice for
this shared utility method, but cannot be used because its local
`EventEmitter` implementation conflicts with the `EventEmitter` import
in ext-tabs.js.

So, this patch provides isolation of global variables declared through
`globals.XXX = ...`, but does not provide isolation for `Cu.import`-ed
logic. Ideally `Cu.import` should always use its second argument to
prevent inadvertent namespace pollution.

MozReview-Commit-ID: 1DTZaKOaeSE
2016-08-17 20:28:19 -07:00
Kris Maglione
dbe2425b27 Bug 1293548: Split browser_ext_pageAction_context into two files. r=me
MozReview-Commit-ID: 1Zj36K0xkX4
2016-08-23 18:18:27 -07:00
Kris Maglione
b0b7864ffc Bug 1271374: Cache-bust page URL. r=me
MozReview-Commit-ID: FAdxwoxRLMA
2016-08-23 18:00:58 -07:00
Shane Caraveo
16d9f3dd57 Bug 1289549 bump slop in jpg color test, r=maglione
MozReview-Commit-ID: GGNze65Lpkl
2016-08-23 15:24:07 -07:00
Hector Zhao
538abb2038 Bug 1295894 - Show localized strings for browserAction/pageAction title. r=kmag
MozReview-Commit-ID: 1SMd3cnUOH4
2016-08-17 14:39:33 +08:00
Ryan VanderMeulen
0c6be0762e Merge inbound to m-c. a=merge 2016-08-22 09:40:41 -04: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
6efdd88867 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
2016-08-15 01:04:58 -07:00
Kris Maglione
6470e45452 Bug 1296888: Add "webextensions" tag to WebExtension tests. r=aswan
MozReview-Commit-ID: 3QYXtpdznrP
2016-08-20 15:41:31 -07:00
Kris Maglione
007774bc99 Bug 1259093: Follow-up: Fix another test race. r=me
MozReview-Commit-ID: 3DsTcQli8Ga
2016-08-20 14:00:37 -07:00
Kris Maglione
b5af7f0b99 Bug 1259093: Follow-up: Fix some test races. r=me
MozReview-Commit-ID: riVGF5q3xV
2016-08-19 17:20:22 -07:00
Kris Maglione
bfd63ddac8 Bug 1259093: Part 3 - Preload browserAction popups to prevent flicker during opening. r=Gijs r=jaws r=bwinton f=mattw
MozReview-Commit-ID: EpAKLV8VPTn
2016-08-19 12:29:11 -07:00
Sebastian Hengst
c7a498ffbd 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
Rob Wu
6189daa99f 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
2016-08-15 01:04:58 -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
Bob Silverberg
7a854b5bd7 Bug 1295301 - history.onVisitRemoved argument is wrong after a call to history.deleteAll, r=aswan
MozReview-Commit-ID: 9b9PKAwcNDA
2016-08-16 09:35:37 -04:00
Wes Kocher
bb9e0744e6 Merge inbound to central, a=merge
a=release to get around the webidl hook for a comment-only change
2016-08-16 17:05:30 -07:00
Rob Wu
c7fc69c140 Bug 1294920 - Fix test expectation on high-density screens in browser_ext_browserAction_pageAction_icon_permissions r=billm
MozReview-Commit-ID: 8iQXNEmsMJ5
2016-08-12 19:15:28 -07:00
Rob Wu
8472b153c7 Bug 1290157 - Always pass an array to tabs.executeScript on success r=kmag
MozReview-Commit-ID: Ctw8RUtfEZC
2016-08-09 00:28:47 -07:00
Phil Ringnalda
6bc09b7861 Backed out 3 changesets (bug 1246034) for Win e10s timeouts in browser_ext_commands_execute_browser_action.js
Backed out changeset f1f24546c26c (bug 1246034)
Backed out changeset 2c396099a21d (bug 1246034)
Backed out changeset 8cce25ece209 (bug 1246034)
2016-08-15 21:36:34 -07:00
Wes Kocher
aec3bff611 Bug 1246034 - ESLint followup a=me CLOSED TREE 2016-08-15 15:20:40 -07:00
Wes Kocher
5b870e1886 Merge m-c to inbound, a=merge 2016-08-15 14:53:49 -07:00
Wes Kocher
924bec4dbe Merge inbound to central, a=merge 2016-08-15 14:20:38 -07:00
Kris Maglione
b3640156d8 Bug 1225215: Follow-up: ESLint fix. r=me
MozReview-Commit-ID: WP5idmrVE6
2016-08-14 20:05:07 -07:00