Commit graph

53 commits

Author SHA1 Message Date
Andrew Swan
84de729f2c Bug 1525445 Part 2: Move users of Extension.generate to ExtensionTestCommon r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D18753

--HG--
extra : rebase_source : 8df66f0ae26dbe126a6bf426532ea3f3ec030f0e
2019-01-03 14:22:44 -08:00
Cosmin Sabou
599a15d354 Merge mozilla-inbound to mozilla-central. a=merge 2019-01-29 12:01:56 +02:00
Shane Caraveo
050ca2e7d4 Bug 1511636: update incognito support to use pref and permissions r=rpl,aswan,kmag
This changes the policy to use the pref and permissions rather than a boolean flag.  Using permissions gets us proper settings on startup without introducing any new overhead.  Going this way flips our tests around so rather than testing an override to turn off private browsing support, we test overrides to enable private browsing support.

Differential Revision: https://phabricator.services.mozilla.com/D14482

--HG--
extra : moz-landing-system : lando
2019-01-28 18:10:47 +00:00
Kris Maglione
e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16750

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Rob Wu
fd1f17a6e3 Bug 1280347 - Require a permission for the API r=mixedpuppy
The new permission is added to make it easier to audit the usage of the
API. It is an optional permission, in case we ever decide to introduce
a permission warning for it.

Differential Revision: https://phabricator.services.mozilla.com/D6771

--HG--
extra : moz-landing-system : lando
2018-09-27 08:21:07 +00:00
Luca Greco
c322d3c14f Bug 1437861 - Implement userScripts.register and execute userScripts js code in isolated sandboxes. r=zombie,mixedpuppy
This patch introduces the userScripts API namespace and the userScripts.register API method,
which allows an extension to register some javascript code to run on the matched webpages
into an isolated sandbox (whereas all the content scripts from the same extension run in
a per-window sandbox shared by all the extension content scripts).

Differential Revision: https://phabricator.services.mozilla.com/D4353

--HG--
extra : moz-landing-system : lando
2018-09-12 16:44:54 +00:00
Bogdan Tara
9c802a42f1 Backed out 4 changesets (bug 1437864, bug 1470466, bug 1437861) for Android xpcshell failures CLOSED TREE
Backed out changeset a6185abfc2f8 (bug 1470466)
Backed out changeset 82d60e34a977 (bug 1437864)
Backed out changeset 7634d9d14449 (bug 1437864)
Backed out changeset a92b6e069d7e (bug 1437861)
2018-09-12 00:57:00 +03:00
Luca Greco
aa17481856 Bug 1437861 - Implement userScripts.register and execute userScripts js code in isolated sandboxes. r=zombie,mixedpuppy
This patch introduces the userScripts API namespace and the userScripts.register API method,
which allows an extension to register some javascript code to run on the matched webpages
into an isolated sandbox (whereas all the content scripts from the same extension run in
a per-window sandbox shared by all the extension content scripts).

Differential Revision: https://phabricator.services.mozilla.com/D4353

--HG--
extra : moz-landing-system : lando
2018-09-11 10:06:30 +00:00
Jared Hirsch
da3fb8092c Bug 1280234 - Expose Telemetry APIs to trusted WebExtensions; r=aswan,gfritzsche
MozReview-Commit-ID: 4uQBq3Qvj0M

--HG--
extra : rebase_source : 4a5bea259d6ad5b557010a88a1da9c26b7f69daf
2018-07-13 12:35:34 -07:00
Kris Maglione
f99ee35b82 Bug 1480244: Part 5 - Run most framescripts in shared scope. r=mconley
Creating non-shared scopes for frame scripts is fairly expensive. After these
changes it's even more expensive. However, many frame scripts have no use for
the shared scopes at all. Run-once scripts which execute in closures, for
instance, make no use of them. And after bug 1472491, neither do most of our
default frame scripts.

MozReview-Commit-ID: 9PK7bYdQ0yh

--HG--
extra : rebase_source : db2516d2f00a75e233e1957649f2b62a9299b7cd
2018-08-10 13:58:18 -07:00
Kris Maglione
24dc48a4df Bug 1480244: Part 3a - Fix non-strict-mode test code which expects this to be bound to its global. r=aswan
A lot of the ad-hoc frame scripts we execute for tests does not run in strict
mode, and therefore has its functions' `this` objects set to the global when
they are called without a target object.

At the moment, this gives them a MessageManager global. Once message managers
become non-global objects, however, it will give them the shared JSM global,
which is not what they expect.

This patches changes scripts which rely on this to explicitly capture or set
the appropriate `this` object for their calls.

MozReview-Commit-ID: DY8DDb0xE1K

--HG--
extra : rebase_source : 86c1fa4df070711f666dfee5487182afe28a7611
2018-08-03 14:33:38 -07:00
Rob Wu
9287b6789f Bug 1477271 - Require "search" permission for search API r=aswan
And re-enable the test_ext_all_apis.html test to ensure that new APIs
are only available by default if the contributor really intents to.

MozReview-Commit-ID: FWIKybrk0EE

--HG--
extra : rebase_source : 58c5bd98ddb59be74b9454995cbbd3edef6c45f9
2018-07-31 20:14:03 +02:00
Boris Zbarsky
6e84b66899 Bug 1476145 part 6. Stop using getInterface(nsIDOMWindowUtils) in toolkit. r=mossop
This is not quite a mechanical change, because some places have a .top or
whatnot snuck in there, so please review carefully!
2018-07-24 19:47:42 -04:00
Andrew Swan
d920f0fd25 Bug 1457224 Enable delayed background page startup on Nightly r=zombie
MozReview-Commit-ID: 8xzBLmQRIL6

--HG--
extra : rebase_source : 1a3182b395416c30ff27873e6539501c80d9a43b
extra : histedit_source : 6945649dab3c354542220c8fc81f4f1347dcb353
2018-04-26 10:28:58 -07:00
Kris Maglione
202290f6bb Bug 1451215: Run codespell on code. r=aswan
MozReview-Commit-ID: HIilZTKcQUY

--HG--
extra : rebase_source : 48ba4b4ac06f6d146ce81050da6c60b6f7c3fbfc
extra : amend_source : cba3e4c100a57889851eaaffff3696d1285655ea
2018-04-03 22:22:07 -07:00
Tomislav Jovanovic
d40743523c Bug 1436450 - Fix <all_urls> as an optional API permission r=aswan
MozReview-Commit-ID: FXiUuNgPlRo

--HG--
extra : rebase_source : ea868f64e198335077419ba9dde87ff9c0f427a3
2018-03-27 00:40:23 +02:00
Cosmin Sabou
05c79c044e Backed out changeset 3a641d9546c6 (bug 1436450) for xpcshell failure on xpcshell/test_ext_permissions.js. 2018-03-28 17:24:53 +03:00
Tomislav Jovanovic
3a8e210260 Bug 1436450 - Fix <all_urls> as an optional API permission r=aswan
MozReview-Commit-ID: FXiUuNgPlRo

--HG--
extra : rebase_source : b4c60c1fd0a6071beea3073d7f734fa7dada24d6
2018-03-27 00:40:23 +02:00
Andrew Swan
5275f0b23f Bug 1402850 Don't include runtime permissions in prompts for webextension updates r=zombie
MozReview-Commit-ID: 1cnNsWLVGmg

--HG--
extra : source : 91675759981c8e6185e6dc67ed88103265b135d8
extra : amend_source : 889380c90839eef813ec14a93b66de2d5ac9ab45
extra : intermediate-source : 947bafefb106318708f5971e49898210d35e2af2
2017-11-08 17:14:11 -08:00
Cosmin Sabou
ec7cfbcbdf Backed out 2 changesets (bug 1402850) for mochitest browser chrome failures at browser_ext_devtools_inspectedWindow.js on a CLOSED TREE
Backed out changeset 839b847c943e (bug 1402850)
Backed out changeset 85b12303f147 (bug 1402850)
2018-02-28 23:13:23 +02:00
Andrew Swan
aa8c33b004 Bug 1402850 Don't include runtime permissions in prompts for webextension updates r=zombie
MozReview-Commit-ID: 1cnNsWLVGmg

--HG--
extra : rebase_source : 4237b853d3a94afe2a99ca4e44d5820b284679a6
extra : intermediate-source : 6f79b872b6102cc7dd1d24bfaaa36d95166c2671
extra : source : 91675759981c8e6185e6dc67ed88103265b135d8
2017-11-08 17:14:11 -08:00
Andrew McCreight
5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Kris Maglione
918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou
9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione
6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian
af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Florian Quèze
0f55cd45be Bug 1421992 - script-generated patch to replace do_execute_soon, do_print and do_register_cleanup with executeSoon, info and registerCleanupFunction, rs=Gijs. 2017-12-21 11:10:23 +01:00
Kris Maglione
4a4c4fdfd4 Bug 1421459: Update to ESLint 4 "indent" rule. r=aswan
MozReview-Commit-ID: LxLDWlsIlSk

--HG--
extra : rebase_source : 5762bdf08ff6c09c1b29f87366bddb552e4c74b2
extra : amend_source : 922a0c03722bd5a81daace7f0289ec3228191cfb
2017-11-28 14:13:59 -08:00
Andrew Swan
4e2fe4e96b Bug 1280235 Part 2 Allow webextensions apis to be limited to "Mozilla Extensions" signed extensions r=kmag
MozReview-Commit-ID: DciT0fWTgef

--HG--
extra : rebase_source : 119665d41d8afa7389753c6b0618ec3a1c7efbf9
2017-10-13 22:28:26 -07:00
Andrew Swan
4d07441bad Bug 1399375 Wait for _uninit in test_ext_permissions.js r=kmag
MozReview-Commit-ID: AF3U2vs5YNw

--HG--
extra : rebase_source : 65d31ad5c261c2ee67f039bb807351e1dbd02d77
2017-10-03 09:06:05 -07:00
Andrew Swan
c61872d2ba Bug 1399550 Explicitly close content page in test_ext_permissions.js r=kmag
MozReview-Commit-ID: HnTbRVHXkWR

--HG--
extra : rebase_source : fae10c0d8f01f0033f8a1c2f365b06223d755441
2017-10-02 14:49:48 -07:00
Ian Moody
abc4c64057 Bug 1375485 - Add test to verify that requesting an origin or permission in the wrong field throws an error. r=aswan
MozReview-Commit-ID: HZwkeUoGDRW

--HG--
extra : rebase_source : 99c32b349b1b7c7aa6047822f69fafb6b92f5fe3
2017-09-23 17:43:43 +01:00
Kris Maglione
1eb9c4b99b Bug 1402066: Part 2 - Enable permissions tests in OOP mode. r=aswan
MozReview-Commit-ID: 4Tv2HAaSV19

--HG--
extra : source : 641430a496824e34170786f6f3bc5e587f2056eb
extra : amend_source : e049c437ad8a70766544a3476a584395df7debb3
2017-09-25 21:05:00 -07:00
Sebastian Hengst
c88c2ff44e Backed out changeset 641430a49682 (bug 1402066) 2017-09-26 11:37:44 +02:00
Kris Maglione
ad260d3d24 Bug 1402066: Part 2 - Enable permissions tests in OOP mode. r=aswan
MozReview-Commit-ID: 4Tv2HAaSV19

--HG--
extra : rebase_source : f9ab74ad8833f5287df8873637be8eb9539e67da
extra : histedit_source : bc86a99a22df05a89d52f305955a490f5de3933d%2Ca1ae6f8c8c53f2f4f48ccd805d7d5ac801b60fea
2017-09-25 21:05:00 -07:00
Tomislav Jovanovic
931df23438 Bug 1394553 - Part 2: Prune the GRANTED_WITHOUT_USER_PROMPT list r=aswan
MozReview-Commit-ID: 844ITHXaauA

--HG--
extra : rebase_source : e95472fa218a9c2189f1c8924908ea1069ec6496
2017-09-04 21:51:25 +02:00
Tomislav Jovanovic
25f753c4cb Bug 1337938 - Add test for permissions localization strings r=aswan,kmag
MozReview-Commit-ID: 27nwTtVLRzE

--HG--
extra : rebase_source : b399d4246a3690de2f684fc68c7e2213400bd2fb
2017-08-26 22:30:35 +02:00
Andrew Swan
5b547e80c0 Bug 1350151 Part 2: Use requireUserInput for permissions.request() r=kmag
MozReview-Commit-ID: ALRlk7ZZ7LR

--HG--
extra : rebase_source : 1b118cb9f0ee576b0f215e95ed3299f7551d3cb1
2017-07-25 22:43:34 -07:00
Andrew Swan
4faf2a2bd8 Bug 1352239 Don't prompt for optional permissions an extension already has r=kmag
MozReview-Commit-ID: EwyzfFB3LyS

--HG--
extra : rebase_source : 87819c14365e9d18f190906413cef513531baddd
2017-07-01 16:49:14 -07:00
Shane Caraveo
9f3dd04302 Bug 1271354 support moz-extension in webrequests, r=kmag
MozReview-Commit-ID: AFP68jIdHHo

--HG--
extra : rebase_source : 8374f8637aa56cef54bec1e8cbc52430f1bfb9c8
2017-07-06 13:08:31 -07:00
Kris Maglione
87f57f76b7 Bug 1322235: Part 3 - Use MatchPatternSet for whiteListedHosts and webRequest. r=aswan,zombie
This is the second step to migrating the policy service to pure native code,
with similar impacts and reasoning to the previous patch.

MozReview-Commit-ID: L5XdPzWNZXM

--HG--
extra : rebase_source : dda006a0afb9d56e2738dbc0b0d94ba0496db5c9
2017-06-03 22:11:20 -07:00
Andrew Swan
34f5bfc90f Bug 1365420 Re-enable and fix test_ext_permissions.js r=zombie
MozReview-Commit-ID: n4CKSvJJQF

--HG--
extra : rebase_source : a7e910487656ed7f3706c8ccee6b5207e4cf9dea
2017-05-17 15:03:22 -07:00
Florian Queze
37ff4fc7cc Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst
a07223d699 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
95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Andrew Swan
bae664ccd8 Bug 1197420 Part 5 Tests for optional permissions r=kmag
MozReview-Commit-ID: 8uViXB1Jgz3

--HG--
extra : rebase_source : 2d897f5c1353e69b1aab17713627960806c159fe
2017-03-16 14:36:26 -07:00
Sebastian Hengst
4687bfe481 Backed out changeset b56c89bfeb0e (bug 1197420) 2017-03-25 17:39:30 +01:00
Andrew Swan
5a12fa89ac Bug 1197420 Part 5 Tests for optional permissions r=kmag
MozReview-Commit-ID: 8uViXB1Jgz3

--HG--
extra : rebase_source : 6a22477086e08520b43cc5daf26f1dd74c1a67e5
2017-03-16 14:36:26 -07:00
Phil Ringnalda
25fd452953 Backed out 5 changesets (bug 1197420) for test_ext_permissions.js and test_chrome_ext_permissions.html timeouts on Fennec
CLOSED TREE

Backed out changeset 8a0125e00903 (bug 1197420)
Backed out changeset 925e3a9499ee (bug 1197420)
Backed out changeset 46e135035f10 (bug 1197420)
Backed out changeset 440bab141509 (bug 1197420)
Backed out changeset 3e690bbe8b5a (bug 1197420)
2017-03-24 20:43:24 -07:00