Commit graph

406 commits

Author SHA1 Message Date
Kris Maglione
60459f8fe7 Bug 1265371: Refactor schema parsing to reduce cyclomatic complexity. r=bsilverberg
MozReview-Commit-ID: HzVrf4yG7hZ

--HG--
extra : rebase_source : 3e7892f8e9b6ce9d5362fd4b0ea877a5cfa235f9
2016-08-30 12:24:32 -07:00
Wes Kocher
309fb2cc5f Merge m-c to inbound, a=merge 2016-08-25 17:14:17 -07:00
Kris Maglione
eedfd4420e Bug 1293287: Close extension popups on extension shutdown. r=aswan
MozReview-Commit-ID: 5lpIk6XrdOM

--HG--
extra : rebase_source : ec403c06c2044fc3d65cc1e830e34670ea4e500d
2016-08-24 16:26:35 -07:00
Rob Wu
bef0b5a7ac Bug 1287010 - Use sandbox instead of JSM for global separation r=billm
MozReview-Commit-ID: GSqmh0xC2hW

--HG--
extra : rebase_source : 9b23172c205a1e4ef49f018eb2fbd5d9bd207adc
2016-08-23 16:19:33 -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
459ac122eb 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

--HG--
extra : rebase_source : 1376a1325fd9bf186e09e1dbe83467f3ad94516f
2016-08-17 20:28:19 -07:00
Kris Maglione
b8397e058b Bug 1293548: Split browser_ext_pageAction_context into two files. r=me
MozReview-Commit-ID: 1Zj36K0xkX4

--HG--
rename : browser/components/extensions/test/browser/browser_ext_pageAction_context.js => browser/components/extensions/test/browser/browser_ext_pageAction_title.js
rename : browser/components/extensions/test/browser/browser_ext_pageAction_context.js => browser/components/extensions/test/browser/head_pageAction.js
extra : rebase_source : 8fc9e53ed34169838635abe5c00c7f9562c4b06c
2016-08-23 18:18:27 -07:00
Kris Maglione
580f9d04d0 Bug 1271374: Cache-bust page URL. r=me
MozReview-Commit-ID: FAdxwoxRLMA

--HG--
extra : rebase_source : f876d4ad6bc7c6e17f8b2f377fdd2a421bed6c64
2016-08-23 18:00:58 -07:00
Shane Caraveo
ff811bd1a9 Bug 1289549 bump slop in jpg color test, r=maglione
MozReview-Commit-ID: GGNze65Lpkl
2016-08-23 15:24:07 -07:00
Hector Zhao
ff7bc87130 Bug 1295894 - Show localized strings for browserAction/pageAction title. r=kmag
MozReview-Commit-ID: 1SMd3cnUOH4

--HG--
extra : rebase_source : 4c746fe866222e9d05177ba9b1d9210e15e1eac2
2016-08-17 14:39:33 +08:00
Ryan VanderMeulen
833833b8c5 Merge inbound to m-c. a=merge 2016-08-22 09:40:41 -04: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
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
Kris Maglione
2c634c4cb0 Bug 1296888: Add "webextensions" tag to WebExtension tests. r=aswan
MozReview-Commit-ID: 3QYXtpdznrP

--HG--
extra : rebase_source : 4aacd77cd2569b9ffc3916a5db3f41dd26bc7b70
2016-08-20 15:41:31 -07:00
Kris Maglione
dbc9f1910b Bug 1259093: Follow-up: Fix another test race. r=me
MozReview-Commit-ID: 3DsTcQli8Ga

--HG--
extra : rebase_source : e32b68893d6684211cd752b88967f7cc74600faa
2016-08-20 14:00:37 -07:00
Kris Maglione
71987e4163 Bug 1259093: Follow-up: Fix some test races. r=me
MozReview-Commit-ID: riVGF5q3xV
2016-08-19 17:20:22 -07:00
Kris Maglione
e9d8b48ce4 Bug 1259093: Part 3 - Preload browserAction popups to prevent flicker during opening. r=Gijs r=jaws r=bwinton f=mattw
MozReview-Commit-ID: EpAKLV8VPTn

--HG--
extra : rebase_source : 6ce6e622734214c7214fc2ddb7ddb2233fc0c8fd
2016-08-19 12:29:11 -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
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
Rob Wu
0077f92ec3 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

--HG--
extra : rebase_source : 7fc804e52184d59cc1dae2f299c644ed13d8a3c7
2016-08-15 23:53:24 -07:00
Bob Silverberg
068821e975 Bug 1295301 - history.onVisitRemoved argument is wrong after a call to history.deleteAll, r=aswan
MozReview-Commit-ID: 9b9PKAwcNDA

--HG--
extra : rebase_source : a0cbbe63b227139085b3641786e14e2a1df13bbe
2016-08-16 09:35:37 -04:00
Wes Kocher
48b8d407c8 Merge inbound to central, a=merge
a=release to get around the webidl hook for a comment-only change

--HG--
extra : amend_source : f7e57101e1a25d3cf3536a256898ec2a21c54b38
2016-08-16 17:05:30 -07:00
Rob Wu
cbd2a581f6 Bug 1294920 - Fix test expectation on high-density screens in browser_ext_browserAction_pageAction_icon_permissions r=billm
MozReview-Commit-ID: 8iQXNEmsMJ5

--HG--
extra : rebase_source : a4f4cf9a1d48194a00aff060c199426f3872a1ce
2016-08-12 19:15:28 -07:00
Rob Wu
65acb9a681 Bug 1290157 - Always pass an array to tabs.executeScript on success r=kmag
MozReview-Commit-ID: Ctw8RUtfEZC

--HG--
extra : rebase_source : 7f76c1c99b5948463e5bfa0f7270fe50f6e95a88
2016-08-09 00:28:47 -07:00
Phil Ringnalda
602a0147b1 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
162c6aa3c3 Bug 1246034 - ESLint followup a=me CLOSED TREE 2016-08-15 15:20:40 -07:00
Wes Kocher
2253eb9510 Merge m-c to inbound, a=merge 2016-08-15 14:53:49 -07:00
Wes Kocher
d602abb016 Merge inbound to central, a=merge 2016-08-15 14:20:38 -07:00
Kris Maglione
9462ff7027 Bug 1225215: Follow-up: ESLint fix. r=me
MozReview-Commit-ID: WP5idmrVE6
2016-08-14 20:05:07 -07:00
Sebastian Hengst
d11b74103a merge mozilla-central to autoland. r=merge a=merge 2016-08-13 13:54:41 +02:00
Sebastian Hengst
9ec085584d Backed out changeset 0c4f81bc2b52 (bug 1252224) for permafailing in browser_ext_browserAction_popup_resize.js on Linux after merge to mozilla-central. r=backout a=backout
MozReview-Commit-ID: KUARkl7QxB7
2016-08-13 13:27:15 +02:00
Wes Kocher
b44cee8b2a Merge fx-team to central, a=merge CLOSED TREE 2016-08-12 14:37:49 -07:00
Wes Kocher
4aec37ca6e Merge m-c to autoland, a=merge 2016-08-12 16:30:03 -07:00
Rob Wu
f50a92851a Bug 1293583 - add test that checks whether the main frame has frame ID 0 r=billm
Tests cannot be run in a new process, so when this test is run along
with other tests, the faulty behavior is not caught.
You can manually check whether the bug is still present by running the
test in isolation:

    mach mochitest browser/components/extensions/test/browser/browser_ext_webNavigation_frameId0.js

MozReview-Commit-ID: LwumSU7zh8R

--HG--
extra : rebase_source : c09fae54cd94af90d7d5391361b33532df6a8d72
2016-08-09 00:12:09 -07:00
Jared Wein
c1a786bb11 Bug 1252224 - Remove synchronous layout flushes and style invalidations during the opening of multiview panels. r=mconley
MozReview-Commit-ID: 9T4gAPwFrXp
* * *
[mq]: temp

MozReview-Commit-ID: Bj91OhNd8ed
* * *
[mq]: temp

MozReview-Commit-ID: J8h8InaMRP4
2016-08-04 17:30:54 -04:00
Carsten "Tomcat" Book
553a2da922 merge mozilla-inbound to mozilla-central a=merge 2016-08-10 15:54:26 +02:00
Kris Maglione
bc51ef01c8 Bug 1280128: [webext] Use transparent backgrounds and correct border radii for popup browsers. r=bwinton ui-r=maritz
MozReview-Commit-ID: 9jmuxdSLmBM

--HG--
extra : source : 9999b6b8022bfe815d79a4f309986d2859285e16
extra : histedit_source : 69afe0d2ecfa9d73e30fc6e363dbfa6849530dcf%2C3a9aaafbb3288f43d7f2b17b0e93597d9a305032
2016-08-09 12:08:04 -07:00
Wes Kocher
8ca795c1c8 Backed out changeset 9999b6b8022b (bug 1280128) for ESLint failures 2016-08-09 11:28:12 -07:00
Kris Maglione
818537d543 Bug 1280128: [webext] Use transparent backgrounds and correct border radii for popup browsers. r=bwinton ui-r=maritz
MozReview-Commit-ID: 9jmuxdSLmBM

--HG--
extra : rebase_source : 377e47f39b1c52e36813f79e9d650c5f6bfab970
extra : histedit_source : c0d5ec2e5143ac4013e203dd75980dfcb43e7c9e
2016-08-09 10:54:53 -07:00
Andrew Swan
b904b2d437 Bug 1286908 Remove id allocation from SpecialPowers loadExtension() r=kmag
Prior to this change, SpecialPowers used the extension id to identiy
extension instances in inter-process messaging.  This required that
an id be allocated from the content process side when loadExtension()
was called, but that made it impossible to test code that exercises the
code path in the AddonManager that allocates ids for extensions that do
not include an id in the manifest (it also made the loadExtension() api
clunky).

With this change, SpecialPowers allocates an internal identifier for
messaging, but this identifier is separate from extension ids.
Confusingly, we still store the actual extension id in an id property
on the object returned by loadExtension(), but there are enough tests
that reference this that it would be unnecessarily disruptive to get
rid of it so it stays for now...

MozReview-Commit-ID: G6xk1mBJJL8

--HG--
extra : rebase_source : a0891e5ba308972c35813f55274badf9edde62f7
extra : source : e8818ef3c28489e196d1db92cabf224861b693c9
2016-08-02 16:04:37 -07:00
Kris Maglione
617494218f Bug 1290117: Call sendMessage response callback when there are no replies. r=robwu
MozReview-Commit-ID: 1BYD1CgZmvD

--HG--
extra : rebase_source : dc6297a85062c6713fa808f935ec7051d8668dc1
extra : amend_source : e398638f70f95835c7a8f8e94ea6945fa763ccb6
2016-08-06 14:21:10 -07:00
Kris Maglione
93814e012e Bug 1293036: Prevent BasePopup._resizeBrowser from being called recursive from MozScrolledAreaChanged events. r=robwu
This doesn't include tests for this behavior, because I'm not sure there's a
good way to test it reliably.

MozReview-Commit-ID: CM5rj1f9YiG

--HG--
extra : rebase_source : 11608a2d0b78802021a4f8aec39f0caa2f75af2c
2016-08-07 12:44:15 -07:00
Kris Maglione
947c1cf7ba Bug 1289527: Hide browserAction and pageAction namespaces when relevant manifest entries are missing. r=aswan
MozReview-Commit-ID: 2gx0pLkHaVJ

--HG--
extra : rebase_source : 94ab5fbc632aedee4dc8261145bc8832ae31f53d
2016-08-06 14:43:58 -07:00
Matthew Wein
019b4824e4 Bug 1246034 - Part 2: [webext] Add support for _execute_browser_action. r=kmag
MozReview-Commit-ID: EIbPidn07qZ

--HG--
extra : rebase_source : 5ed49fb3b70fa07b6ec5430381c73d702d156898
2016-07-08 15:02:49 -07:00
Kris Maglione
1d020acead Bug 1246034 - Part 1: [webext] Add a helper function to trigger a browserAction. r=jaws
MozReview-Commit-ID: JUW6oUpWiN4

--HG--
extra : rebase_source : 91473d3b5278df43694709fe732b176696f25151
2016-08-05 18:35:39 -07:00
fiveNinePlusR
f69df51c78 Bug 1289213 - Part 2: Fall back to the tab.label when there is no browser.contentTitle available. r=kmag
When a tab is unloaded, the session browser.contentTitle is unavailable so this patch allows the title to be exposed when the tab is unloaded.
2016-08-11 19:44:00 -04:00
fiveNinePlusR
479a4f4ae3 Bug 1291830 - Do not return tabs that are in the process of closing from a chrome.tabs.query call. r=kmag
--HG--
extra : rebase_source : 24e51c2a777bf22b4314f7001018aa8ae756ea53
2016-08-09 16:43:33 -07:00
Kris Maglione
d63b08badc Bug 1293099: Fill panel arrow and arrow content with browser body's background color. r=bwinton ui-r=maritz
MozReview-Commit-ID: 3xf31UgUy2A

--HG--
extra : rebase_source : 4f1e4149587da7a2c0aefdde7c8880ea21330393
2016-08-08 14:06:19 -07:00
Kris Maglione
8e7896a8c6 Bug 1277181: Split up browser_ext_browserAction_page_icon test. r=trivial
MozReview-Commit-ID: 2A0TZzTrREu

--HG--
rename : browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js => browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon_permissions.js
extra : rebase_source : fc4be9e1db1909aa57dc96e48ab840187ab7b9fb
2016-08-10 12:19:45 -07:00
Kris Maglione
4f1b1dda0b Bug 1225215: [webext] Raise the expected errors when given invalid tab IDs. r=aswan
MozReview-Commit-ID: E5G0GmVhzLh

--HG--
extra : rebase_source : 5c6624b9d2d06109a1b047ad48dcac7e9405ee59
extra : amend_source : fb23020f7d2772f56fabc61f2e32f7d9c4c2f52a
2016-02-26 17:56:30 -08:00