Граф коммитов

254 Коммитов

Автор SHA1 Сообщение Дата
Mark Banner 2c4e35b0a6 Bug 1620218 - Automatic code fixes for Prettier 1.18.2 upgrade. r=mossop,webcompat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D65509

--HG--
extra : moz-landing-system : lando
2020-03-08 21:45:16 +00:00
Ehsan Akhgari dc998c5c5a Bug 1592599 - Switch nsIDocShell.getDocShellEnumerator() away from using nsISimpleEnumerator; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D51100

--HG--
extra : moz-landing-system : lando
2019-11-18 20:11:58 +00:00
Luca Greco 71af36db2e Bug 1550470 - Prevent nsIDOMWindowUtils.removeSheet errors due to content scripts CSS cleanups on closed windows. r=zombie
Differential Revision: https://phabricator.services.mozilla.com/D47806

--HG--
extra : moz-landing-system : lando
2019-10-02 15:08:39 +00:00
Kris Maglione 20d33cc9da Bug 1584483: Wait for CSS to load before injecting content scripts. r=zombie
We have several tests which assume that the CSS associated with a content
script will have loaded by the time the script executes. There is nothing
guaranteeing this, though, and they currently mostly pass due to a combination
of luck and successful pre-loading.

This patch fixes the injection logic to always wait for a script's CSS entries
to finish loading before executing its JS, so behavior at least consistently
matches expectations.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 20:58:13 +00:00
Brian Hackett 5cba39ef12 Bug 1577407 - Mark extension evaluated code appropriately for the debugger, r=jlast.
Differential Revision: https://phabricator.services.mozilla.com/D46365

--HG--
extra : moz-landing-system : lando
2019-09-18 21:50:53 +00:00
monikamaheshwari 9d60e0d578 Bug 1578683 Turn on ESLint rule prefer-boolean-length-check for toolkit and browser r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D45629

--HG--
extra : moz-landing-system : lando
2019-09-14 09:39:26 +00:00
Mark Banner b1970e6a2f Bug 1571466 - Cleanup unnecessary ESLint global definitions. r=mossop
These are raised as redeclares or unused variables by ESLint 6.

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

--HG--
extra : moz-landing-system : lando
2019-08-19 07:11:56 +00:00
Shane Caraveo 3a4666603f Bug 1542403 Add extension activity logging facility r=rpl,zombie
Logging for extension api calls, api event dispatches,
and content script injections.

To view extension activity, see:
https://github.com/aswan/firefox-activity-log

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

--HG--
extra : moz-landing-system : lando
2019-08-16 23:57:30 +00:00
Jonathan Kingston 31441f82ea Bug 1560455 - rename CodebasePrincipal to ContentPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35504

--HG--
extra : moz-landing-system : lando
2019-07-08 16:37:45 +00:00
Victor Porof 4a06c925ac Bug 1561435 - Format toolkit/components/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : b5be5b4f4b47c256e28a29f665dc754f6407ee7f
2019-07-05 11:14:05 +02:00
sakshaat d781937a67 Bug 1517483 - Get rid of nsIScriptSecurityManager::IsSystemPrincipal r=bzbarsky
Replaced instances of callers in both C++ and JS files to query the state from the principal directly.

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

--HG--
extra : moz-landing-system : lando
2019-03-24 20:36:25 +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
Luca Greco 8bb370504e Bug 1464711 - Fix typo in ExtensionContent script.requiresCleanup getter. r=zombie
This patch fixes the typo in the requiresCleanup getter and adds an additional step
in the automated tests to verify that the scripts created by browser.tabs.removeCSS
are not being added to the content scripts that requires cleanup.

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

--HG--
extra : moz-landing-system : lando
2019-01-24 17:18:22 +00:00
Kris Maglione 778252994f Bug 1513366: Part 5 - Migrate extension process script to a JSM. r=aswan
This simplifies things all around, and gets rid of one more unnecessary
component registration.

--HG--
rename : toolkit/components/extensions/extension-process-script.js => toolkit/components/extensions/ExtensionProcessScript.jsm
extra : rebase_source : 7ceb6ada0730f8241bbd5ddbd889a320da22b1b1
2018-12-12 17:58:19 -08:00
Luca Greco 2074f536c7 Bug 1509339 - Implement a UserScript API object and remove the userScripts.setScriptAPIs method. r=zombie,robwu
Depends on D12676

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

--HG--
extra : moz-landing-system : lando
2018-11-30 16:10:58 +00:00
Luca Greco 3a91800a12 Bug 1509339 - Implement a userScript.onBeforeScript API event. r=zombie,robwu
Depends on D10061

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

--HG--
extra : moz-landing-system : lando
2018-11-30 16:09:34 +00:00
Ehsan Akhgari 6f7b03e600 Bug 1504574 - Remove the XPCOM registration for nsDocumentEncoder; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D10856
2018-11-05 23:16:04 -05:00
Rob Wu 92e0725cbb Bug 1491397 - Correctly forward falsey scriptMetadata in userScripts API r=rpl
This also adds new test coverage for the previously untested features:
- "file" in "js" param to userScripts.register works.
- "allFrames" set to true in userScripts.register works.
- scriptMetadata accepts primitive values, and in particular falsey
  values in particular (= bug 1491397 ).
 - scriptMetadata is the same object in all API script calls.

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

--HG--
extra : moz-landing-system : lando
2018-10-15 18:05:08 +00:00
Andrew Swan 5abc00958c Bug 1498311 Handle content scripts properly on platforms without oop extensions r=zombie
--HG--
extra : rebase_source : 35e207d45979b5166833ad47c9e8b5892af15186
extra : source : 1cec1e9365524792ae0aeb11e53c33885f77f44e
2018-10-11 11:31:40 -07:00
shindli 620ed51b95 Backed out changeset 1cec1e936552 (bug 1498311) for ES linting failure 2018-10-12 00:10:59 +03:00
Andrew Swan 631def558c Bug 1498311 Handle content scripts properly on platforms without oop extensions r=zombie
--HG--
extra : rebase_source : 96f10978d9f19c2a8ec007a725643cd58395ccb6
2018-10-11 11:31:40 -07:00
Tomislav Jovanovic 7910836509 Bug 1496532 - Stop running content scripts on preallocated new tab page r=aswan
Differential Revision: https://phabricator.services.mozilla.com/D7976

--HG--
extra : moz-landing-system : lando
2018-10-08 19:40:20 +00:00
Luca Greco 202b39bc4b Bug 1491051 - Avoid awaiting a promise when all the content scripts are already precompiled and cached. r=robwu,mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D5794

--HG--
extra : moz-landing-system : lando
2018-09-15 18:42:23 +00:00
Luca Greco 87e37e32a0 Bug 1491024 - Rename userScripts manifest property to follow manifest property name conventions. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D5777

--HG--
extra : source : f1cc448b5137c220962a35f1816f112f931de119
2018-09-13 15:33:12 +00:00
Cosmin Sabou 3061c72b4b Backed out changeset f1cc448b5137 (bug 1491024) for failures on test_ext_userScripts. CLOSED TREE 2018-09-13 22:11:41 +03:00
Luca Greco 44493dc39f Bug 1491024 - Rename userScripts manifest property to follow manifest property name conventions. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D5777

--HG--
extra : moz-landing-system : lando
2018-09-13 15:33:12 +00:00
Luca Greco 0f496e199e Bug 1470466 - Use a different telemetry histogram key for the userScripts injection. r=janerik,mixedpuppy
This patch adds a new telemetry histogram for the userScripts injection time and adds an additional test case to verify that the expected telemetry histograms are being updated.

This phabricator revision depends on the following bugs and their related mozreview requests:

- [Bug 1437861](https://bugzilla.mozilla.org/1437861) Implement userScripts.register and execute userScripts js code in isolated sandboxes (https://reviewboard.mozilla.org/r/219856/)
- [Bug 1437864](https://bugzilla.mozilla.org/1437866) Implement userScripts API methods to allow an extension to inject custom APIs in the isolated userScripts sandboxes (https://reviewboard.mozilla.org/r/220630/)

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

--HG--
extra : moz-landing-system : lando
2018-09-12 16:58:55 +00:00
Luca Greco 6056022481 Bug 1437864 - Implement userScripts API methods to allow an extension to inject custom APIs in the isolated userScripts sandboxes. r=zombie,mixedpuppy
MozReview-Commit-ID: 3GIFhnxMJVn

Depends on D4354

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

--HG--
extra : moz-landing-system : lando
2018-09-12 16:46:24 +00:00
Luca Greco 8cba4aaaeb Bug 1437864 - Save a copy of the Error and Promise globals from extension context before they can be redefined. r=zombie,mixedpuppy
MozReview-Commit-ID: ALNJDiBwZL7

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

--HG--
extra : moz-landing-system : lando
2018-09-12 16:46:06 +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 0a4bdf7e7e Bug 1470466 - Use a different telemetry histogram key for the userScripts injection. r=janerik,mixedpuppy
This patch adds a new telemetry histogram for the userScripts injection time and adds an additional test case to verify that the expected telemetry histograms are being updated.

This phabricator revision depends on the following bugs and their related mozreview requests:

- [Bug 1437861](https://bugzilla.mozilla.org/1437861) Implement userScripts.register and execute userScripts js code in isolated sandboxes (https://reviewboard.mozilla.org/r/219856/)
- [Bug 1437864](https://bugzilla.mozilla.org/1437866) Implement userScripts API methods to allow an extension to inject custom APIs in the isolated userScripts sandboxes (https://reviewboard.mozilla.org/r/220630/)

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

--HG--
extra : moz-landing-system : lando
2018-09-11 10:11:26 +00:00
Luca Greco fd88da28d9 Bug 1437864 - Implement userScripts API methods to allow an extension to inject custom APIs in the isolated userScripts sandboxes. r=zombie,mixedpuppy
MozReview-Commit-ID: 3GIFhnxMJVn

Depends on D4354

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

--HG--
extra : moz-landing-system : lando
2018-09-11 10:09:50 +00:00
Luca Greco 049cf75aa4 Bug 1437864 - Save a copy of the Error and Promise globals from extension context before they can be redefined. r=zombie,mixedpuppy
MozReview-Commit-ID: ALNJDiBwZL7

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

--HG--
extra : moz-landing-system : lando
2018-09-11 10:08:03 +00: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
Luca Greco bc6ccc75fd Bug 1489315 - Move ExtensionTelemetry into its own JSM module. r=mixedpuppy
This patch moves the ExtensionTelemetry helpers (added into ExtensionUtils.jsm by Bug 1483002)
into a new ExtensionTelemetry.jsm and makes the ExtensionTelemetry a lazy getter on every one
of the JSM and API modules that are going to use it, so that we don't have to load these helpers
until they are actually used and we can reduce their impact on the base content memory usage.

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

--HG--
extra : moz-landing-system : lando
2018-09-07 16:27:44 +00:00
Luca Greco 88b7be38f8 Bug 1483002 - Added WEBEXT probes keyed by addon id. r=janerik,mixedpuppy
This patch contains a set of changes needed to add WEBEXT telemetry probes keyed by addon id.

The telemetry probes keyed by addon id has been added as separate telemetry histograms
named after the related generic WEBEXT probe with the additional "_BY_ADDONID" suffix.

A set of small helper methods have been defined in a new ExtensionTelemetry object, exported
by the ExtensionUtils.jsm.

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

--HG--
extra : moz-landing-system : lando
2018-09-05 20:16:35 +00:00
Kris Maglione b821d119a0 Bug 1486182: Part 2b - Update XPCOMUtils.enumerateCategoryEntries callers to use the category manager directly. r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D4279

--HG--
extra : rebase_source : f57e09927871a23ed3c105325369e5c35ffd3d93
2018-08-24 17:05:41 -07:00
Kris Maglione 6adf9223ce Bug 1484496: Part 5b - Convert toolkit/ nsISimpleEnumerator users to use JS iteration. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D3730

--HG--
extra : rebase_source : 935f166ec2c6581ba6f3fffe912404e81c8dc3d6
extra : histedit_source : ba701801de5205dcce6cfdccabe7b26aa7c7859c
2018-08-18 19:27:50 -07:00
Kris Maglione 8a20a1620e Bug 1484373: Part 10 - Move some receiveMessage code to ExtensionContent.jsm. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3700

--HG--
extra : rebase_source : 5134540458628a004fa81e8978c2ba71aa5f6b6b
extra : histedit_source : 786919bc2ed8ebda1db004a13364a636a1f1f717
2018-08-17 22:20:45 -07:00
Kris Maglione c6994239e3 Bug 1484373: Part 5 - Minimize the amount of content script options processing we do in child processes r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D3695

--HG--
extra : rebase_source : 5e99ca727b84d376744f6937bf96c60882038dec
extra : histedit_source : 2c3621e71dec052992a7d4f4ca33efd748f069ba
2018-08-17 20:02:52 -07:00
Kris Maglione 02ba563399 Bug 1463016: Part 5 - Add domWindow property to DocShellTreeItem and update callers to use it. r=nika
MozReview-Commit-ID: FRRAdxLHRtG

--HG--
extra : source : 0d69b4fb1ed43751cfcbc0b4f2fe3b6a49bc0494
extra : histedit_source : d0ce31513ffaae2fd7f01f6567a97b6d2d96b797%2Cfff837de7a00fa90809d2c3e755097180dfd56d8
2018-05-20 18:10:16 -07:00
Narcis Beleuzu 561ccb2ceb Backed out 2 changesets (bug 1463016, bug 1463291) for geckoview failures
Backed out changeset fcfb99baa0f0 (bug 1463291)
Backed out changeset 0d69b4fb1ed4 (bug 1463016)
2018-07-29 03:55:23 +03:00
Kris Maglione 636f1839e5 Bug 1463016: Part 5 - Add domWindow property to DocShellTreeItem and update callers to use it. r=nika
MozReview-Commit-ID: FRRAdxLHRtG

--HG--
extra : rebase_source : 36565ef5e74360aad14062005e5bdab2939e888b
2018-05-20 18:10:16 -07:00
Rob Wu 7713dfc025 Bug 1459750 - Remove unused principal variable r=rpl
Variable `principal` is only used when `this.isExtensionPage` is false.
So move this inside the branch where this condition is satisfied, and
remove the `else if (this.isExtensionPage) { ... }` block.

(This is a follow-up to bug 1214658, where the check was introduced that
 obsoleted the principal variable when `this.isExtensionPage` due to the
 use of `contentWindow` instead of `principal`).
(`principal = contentPrincipal` was already unused at its introduction
 in bug 1317697)

MozReview-Commit-ID: F7VX9vAH8MM

--HG--
extra : rebase_source : f2cbb1305d2ec98b471c0b43084e7b2c57ad05cd
2018-05-08 11:31:57 +02:00
Rob Wu 74c2f942c0 Bug 1459750 - Add JSDoc to ExtensionContent.Script constructor r=rpl
`contentScripts` in extension-process-script.js lazily instantiates
`ExtensionContent.Script` using the key as "matcher".

This "matcher" is usually a `WebExtensionContentScript`, except in
case of "Extension:Execute". Then the object is a
`WebExtensionContentScript`, extended with some expando properties.

MozReview-Commit-ID: 3hMAy9Ff1lr

--HG--
extra : rebase_source : fba3ee4672541ddbdb0bb6d51044f989c606e3cb
2018-05-08 01:59:48 +02:00
Kris Maglione fcedebb912 Bug 1471102: Move more code out of ExtensionUtils.jsm. r=aswan
MozReview-Commit-ID: Fqlv5BRuuW8

--HG--
extra : rebase_source : 348f037abd9cecfa080183bc365e5f005eac1bd6
extra : amend_source : 05dbfd12f553fc3f2a93374402e34d271e26d767
2018-06-25 19:30:21 -07:00
Kris Maglione 7b7264f453 Bug 1464548: Part 3 - Update callers to use defineLazyGlobalGetters. r=mccr8
MozReview-Commit-ID: 9APGewiDDYB

--HG--
extra : rebase_source : 2931dd0eec0e4206414b698a9700fc20d922eb3a
2018-05-25 17:02:29 -07:00
Kris Maglione 5bbc8d23df Bug 1445026: Don't try to decode a binary hash blob as UTF-8. r=rpl
MozReview-Commit-ID: 91QNBYVQgQU

--HG--
extra : rebase_source : c7c1507e823bbbbeb9c6b9fe26139b20a9c1dda8
2018-03-12 14:18:43 -07:00
Kris Maglione e427ba000e Bug 1420485: Follow-up: Remove unnecessary single-use stringToCryptoHash function. r=me
MozReview-Commit-ID: H1tPnsN0v2J

--HG--
extra : rebase_source : 616f0b88c1066ede9e45f6090115c4b45ca66db6
2018-03-11 22:25:56 -07:00