Commit Graph
621 Commits
Author SHA1 Message Date
Cristina Horotan 71070aa087 Bug 1841281 - enable test_basics.html a=test-only 2023-07-28 15:23:47 +03:00
Cristina Horotan e6fb06e633 Bug 1841281 - disable test_basics.html on win and linux debug for frequent failures. r=aryx DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D184799
2023-07-28 09:39:59 +00:00
Tooru Fujisawa 0d747520b8 Bug 1843795 - Part 1: Rewrite netwerk/base/NetUtil.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=necko-reviewers,credential-management-reviewers,devtools-reviewers,sgalich,kershaw
Depends on D183690

Differential Revision: https://phabricator.services.mozilla.com/D183691
2023-07-19 12:06:16 +00:00
Tooru Fujisawa 2355183b15 Bug 1843790 - Part 4: Rewrite toolkit/modules/FileUtils.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D183663
2023-07-18 23:06:32 +00:00
Tooru Fujisawa cd6d2d881f Bug 1843790 - Part 3: Rewrite toolkit/modules/Console.sys.mjs consumers in html/xhtml to use ChromeUtils.importESModule. r=Gijs,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D183662
2023-07-18 23:06:32 +00:00
Alexandre Poirot c158bae2fa Bug 1836856 - [devtools] Drop support of DevToolsClient.request's second onResponse argument. r=devtools-reviewers,bomsy
This is no longer used. The returned promise should be used instead.

There was also some old lefovers in WebConsole Front related to network events.
As we no longer have legacy listeners, this is no longer used.
The frontend code now uses DevToolsClient.request directly to query the NetworkEventActor's.

Differential Revision: https://phabricator.services.mozilla.com/D180980
2023-06-26 11:08:46 +00:00
Sandor Molnar 49cbc9e36b Backed out 3 changesets (bug 1836856) for causing mochitest failures in devtools/shared/webconsole/test/chrome/test_network_security-hsts.html CLOSED TREE
Backed out changeset 636272515c00 (bug 1836856)
Backed out changeset 0fe632ebb487 (bug 1836856)
Backed out changeset 6850948b14c0 (bug 1836856)
2023-06-23 14:36:31 +03:00
Alexandre Poirot e92e641b51 Bug 1836856 - [devtools] Drop support of DevToolsClient.request's second onResponse argument. r=devtools-reviewers,bomsy
This is no longer used. The returned promise should be used instead.

There was also some old lefovers in WebConsole Front related to network events.
As we no longer have legacy listeners, this is no longer used.
The frontend code now uses DevToolsClient.request directly to query the NetworkEventActor's.

Differential Revision: https://phabricator.services.mozilla.com/D180980
2023-06-23 08:22:04 +00:00
Barret Rennie c21ee0d6d6 Bug 1747468 - Remove FileUtils.getFile from devtools/ r=devtools-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D180461
2023-06-15 01:59:11 +00:00
Nicolas Chevobbe 328e6ba0a9 Bug 1835680 - [devtools] Use proxy target when walking up prototype chain for autocomplete. r=devtools-reviewers,jdescottes.
In the JSPropertyProvider, we are walking up the prototype to retrieve properties.
For proxies with `getPrototypeOf` trap, this means that we were returning erroneous
values, as the prototype chain of the proxy isn't altered by the trap.
Worse, it could lead to infinite loop if the trap was setting a circular reference.

To avoid this, when dealing with a proxy, we retrieve the prototype of the proxy
target.

Test cases are added to ensure we don't regress this.

Differential Revision: https://phabricator.services.mozilla.com/D179640
2023-06-01 15:30:18 +00:00
Stanca Serban ebb32fa89e Backed out changeset 2f0f9d27fb0d (bug 1835680) for causing mochitests failures in test_jsterm_autocomplete.html. CLOSED TREE 2023-06-01 12:09:17 +03:00
Nicolas Chevobbe 73f79879ed Bug 1835680 - [devtools] Use proxy target when walking up prototype chain for autocomplete. r=devtools-reviewers,jdescottes.
In the JSPropertyProvider, we are walking up the prototype to retrieve properties.
For proxies with `getPrototypeOf` trap, this means that we were returning erroneous
values, as the prototype chain of the proxy isn't altered by the trap.
Worse, it could lead to infinite loop if the trap was setting a circular reference.

To avoid this, when dealing with a proxy, we retrieve the prototype of the proxy
target.

Test cases are added to ensure we don't regress this.

Differential Revision: https://phabricator.services.mozilla.com/D179640
2023-06-01 08:38:35 +00:00
Tooru Fujisawa af93372662 Bug 1832766 - Do not use lexical variable in test_jsterm_autocomplete.html to avoid redeclaration error in verify mode. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D179171
2023-05-26 10:45:51 +00:00
Tooru Fujisawa 504c8e1285 Bug 1831819 - Remove per-global function support in eager evaluation allow list. r=devtools-reviewers,nchevobbe
Stop supporting instance methods and getters in allowlist.
Now the allowlist is independent of global and can be shared across multiple
globals.

Differential Revision: https://phabricator.services.mozilla.com/D178884
2023-05-26 10:45:27 +00:00
Noemi Erli 7d41e7869b Backed out 3 changesets (bug 1831819, bug 1832769, bug 1831826) for causing build bustages in Object-isSameNativeWithJitInfo.js CLOSED TREE
Backed out changeset 260ffbbe45e0 (bug 1832769)
Backed out changeset e6a25ac049e4 (bug 1831819)
Backed out changeset dc4f6fa24aa3 (bug 1831826)
2023-05-26 06:17:20 +03:00
Tooru Fujisawa 6a2ac06235 Bug 1831819 - Remove per-global function support in eager evaluation allow list. r=devtools-reviewers,nchevobbe
Stop supporting instance methods and getters in allowlist.
Now the allowlist is independent of global and can be shared across multiple
globals.

Differential Revision: https://phabricator.services.mozilla.com/D178884
2023-05-26 02:53:58 +00:00
Mark Banner 0666077666 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Mark Banner 91fde42f7b Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Tooru Fujisawa b63a55d9fa Bug 1820951 - Part 1: Implement DevToolsUtils.hasSafeGetter based on explicit allowlist and DebuggerObject.prototype.isNativeGetterWithJitInfo. r=nchevobbe,devtools-reviewers
Perform the same test as `nativeIsEagerlyEvaluateable` in `hasSafeGetter`.

Differential Revision: https://phabricator.services.mozilla.com/D175093
2023-05-12 06:21:41 +00:00
Tooru Fujisawa 283d429cea Bug 1815381 - Part 3: Remove DOM getters from explicit allowlist. r=nchevobbe,devtools-reviewers,ochameau
Now that all DOM getters are caught by `isNativeGetterWithJitInfo`,
we don't need the DOM getters in explicit allowlist.

Differential Revision: https://phabricator.services.mozilla.com/D175091
2023-05-12 06:21:41 +00:00
Mark Banner 0fadbc1ec4 Bug 1829618 - Enable Prettier on json files (automatic fixes). r=perftest-reviewers,webcompat-reviewers,extension-reviewers,andi,desktop-theme-reviewers,pip-reviewers,devtools-reviewers,sync-reviewers,mossop,denschub,dao,sparky,robwu,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D176336
2023-05-09 16:14:51 +00:00
Alexandre Poirot cd7f049054 Bug 1830919 - [devtools] Remove unused add-on versus original commands. r=devtools-reviewers,jdescottes
We used to support commands being registered by Add-ons or third party code.
We no longer do and can simplify this class.

This helped see a private field usage from eval-with-debugger.

Also remove hasCommand and getCommand which aren't used.
These methods were used in the past to wrap/chain commands,
which isn't done anymore.

Differential Revision: https://phabricator.services.mozilla.com/D177139
2023-05-09 11:45:24 +00:00
Alexandre Poirot a8fa2fe085 Bug 1830919 - [devtools] Use explicit modules for web console commands management in the server codebase. r=devtools-reviewers,jdescottes
This code has been left unchanged since Firebug...
This ought some maintenance to better highlight where to implement new commands.
"utils.js" wasn't great ;)

Doing this highlights the fact that we have two type of commands.
See the new jsdoc alonside validCommands.

Differential Revision: https://phabricator.services.mozilla.com/D177138
2023-05-09 11:45:24 +00:00
Mathew Hodson f5014038b0 Bug 1824606 - Update Reflect consumers to ESM. r=Standard8,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D175201
2023-04-14 08:48:39 +00:00
Nicolas Chevobbe 70245631b7 Bug 860312 - [devtools] Add LegacyLenientThis getters to unsafe list. r=devtools-reviewers,ochameau.
Getters with LegacyLenientThis attribute will trigger a warning in the console
if it's called with the unexpected `this`.
We can't tell in DevTools if we have the "right" `this`.
For example displaying an `HTMLDivElementPrototype` object, we'll trigger the
warning because of the `onmouseenter` getter, which is supposed to be called
with the `HTMLElement` instance, which we don't have at this point.

For this reason, we exclude those from being safe getters, which will prevent
triggering the warning.

Differential Revision: https://phabricator.services.mozilla.com/D174070
2023-04-11 06:25:58 +00:00
Nicolas Chevobbe cab2e6654d Bug 860312 - [devtools] Generate list of unsafe getters. r=devtools-reviewers,ochameau.
We'll only need those names to avoid executing getters.
The file is renamed to better convey what data it represents.

Differential Revision: https://phabricator.services.mozilla.com/D174056
2023-04-11 06:25:56 +00:00
Tooru Fujisawa 8ccbac98ad Bug 1806598 - Part 6: Add Location accessors, window.location, and document.location to allowlist. r=nchevobbe
Location related accessors are not marked Pure, but some testcase expects
them to be eagerly evaluateable.

Differential Revision: https://phabricator.services.mozilla.com/D168340
2023-02-07 07:36:16 +00:00
Tooru Fujisawa 7f2aefdc4c Bug 1806598 - Part 5: Add Window accessors to allowlist. r=nchevobbe
Add support for [Global] extended attribute and methods/getters on instances.

This retrieves the Xray getter function of the given eval global, so that even
if some configurable properties are modified by the web content, debugger
can see the original getters, and pass them to isSameNativeWithJitInfo.

Differential Revision: https://phabricator.services.mozilla.com/D168339
2023-02-07 07:36:15 +00:00
Tooru Fujisawa 5f7402f606 Bug 1806598 - Part 4: Collect safe DOM getters into webidl-pure-allowlist.js. r=nchevobbe
Also refactor the allowlist structure to represent static vs prototype and
methods vs getters clearly.

And also moved the pre-defined pure methods list into GenerateDataFromWebIdls.py
for simplicity.

Differential Revision: https://phabricator.services.mozilla.com/D168338
2023-02-07 07:36:15 +00:00
Sandor Molnar 190b92321c Backed out 11 changesets (bug 1806598, bug 1812905, bug 1812540) for causing dt failures in devtools/client/webconsole/test/browser/browser_console_evaluation_context_selector.js CLOSED TREE
Backed out changeset 3b0e28b20def (bug 1812540)
Backed out changeset 810ed5832764 (bug 1812540)
Backed out changeset 9e042da8472f (bug 1806598)
Backed out changeset ab04e3122f20 (bug 1806598)
Backed out changeset f97c01add0a5 (bug 1806598)
Backed out changeset de9d04dc5014 (bug 1806598)
Backed out changeset 3808fc5bf528 (bug 1806598)
Backed out changeset 9be2509e8540 (bug 1806598)
Backed out changeset 3fc6c5d9d620 (bug 1806598)
Backed out changeset 297a91be123b (bug 1806598)
Backed out changeset 24cc5069faf3 (bug 1812905)
2023-02-06 07:19:51 +02:00
Tooru Fujisawa a872bd3260 Bug 1806598 - Part 6: Add Location accessors, window.location, and document.location to allowlist. r=nchevobbe
Location related accessors are not marked Pure, but some testcase expects
them to be eagerly evaluateable.

Differential Revision: https://phabricator.services.mozilla.com/D168340
2023-02-06 03:42:36 +00:00
Tooru Fujisawa 6c7c4283d1 Bug 1806598 - Part 5: Add Window accessors to allowlist. r=nchevobbe
Add support for [Global] extended attribute and methods/getters on instances.

This retrieves the Xray getter function of the given eval global, so that even
if some configurable properties are modified by the web content, debugger
can see the original getters, and pass them to isSameNativeWithJitInfo.

Differential Revision: https://phabricator.services.mozilla.com/D168339
2023-02-06 03:42:36 +00:00
Tooru Fujisawa 355e58e88e Bug 1806598 - Part 4: Collect safe DOM getters into webidl-pure-allowlist.js. r=nchevobbe
Also refactor the allowlist structure to represent static vs prototype and
methods vs getters clearly.

And also moved the pre-defined pure methods list into GenerateDataFromWebIdls.py
for simplicity.

Differential Revision: https://phabricator.services.mozilla.com/D168338
2023-02-06 03:42:36 +00:00
Mark Banner b3474f4614 Bug 1812977 - Remove now unnecessary import-globals-from statements in devtools. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D168071
2023-01-30 19:33:38 +00:00
Marco Castelluccio ba39d286d5 Bug 1801836 - Remove no longer necessary 'from __future__' imports. r=linter-reviewers,glandium,webdriver-reviewers,perftest-reviewers,geckoview-reviewers,jld,ahal,owlish,afinder DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D165395
2022-12-23 22:45:46 +00:00
Julian Descottes d5638c413b Bug 1788777 - [devtools] Group all network-observer related modules in a single folder r=ochameau,Sasha
This patch is only moving all network observer files in the same folder.
For webdriver reviewers, we could update our phabricator herald rule to be added as reviewers for changes in this folder?

Differential Revision: https://phabricator.services.mozilla.com/D160241
2022-11-08 20:27:50 +00:00
Mark Banner 5407bdffa8 Bug 1792341 - Migrate more toolkit/modules consumers to use direct ES module import. r=Gijs,webdriver-reviewers,perftest-reviewers,necko-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,sgalich,owlish,bytesized,AlexandruIonescu,whimboo,mconley,mixedpuppy
Mainly automated changes. Some manual ESLint fixes and whitespace cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D158452
2022-10-18 11:21:26 +00:00
Julian Descottes 35484346df Bug 1795466 - [devtools] Avoid loading the NetworkHelper in jsonview converter-child r=ochameau
Depends on D159219

Differential Revision: https://phabricator.services.mozilla.com/D159456
2022-10-17 19:56:20 +00:00
Julian Descottes d947f89f30 Bug 1788762 - Migrate devtools network observer to an ES module r=ochameau
This is a very basic migration from commonjs modules to ESM for all modules related to network observation.
A few classes have been introduced instead of prototype-based classes, but otherwise the code remains mostly untouched.

We can followup to introduce private fields and methods if there's interest?

Differential Revision: https://phabricator.services.mozilla.com/D156968
2022-10-17 19:56:18 +00:00
Alexandre Poirot bde84f5b65 Bug 1793604 - [devtools] Convert Loader.jsm to ESM. r=perftest-reviewers,geckoview-reviewers,preferences-reviewers,owlish,kshampur,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D158582
2022-10-14 12:19:42 +00:00
wartmanm cc54dbcebf Bug 1767213 - JSPropertyProvider should use current stackframe for eager evaluation r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D158456
2022-10-13 12:02:07 +00:00
Alexandre Poirot 07e6ce0083 Bug 1792848 - [devtools] Use absolute URLs to import modules in devtools/shared. r=Honza,devtools-backward-compat-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D158643
2022-10-12 15:56:22 +00:00
Alexandre Poirot a3b72117bf Bug 1793575 - [devtools] Convert jsdebugger.jsm to jsdebugger.sys.mjs. r=Honza,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D158571
2022-10-06 14:21:22 +00:00
Alexandre Poirot 59fe57c052 Bug 1793396 - [devtools] Use absolute URLs in all usages of loader.lazyRequireGetter. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158489
2022-10-03 18:57:13 +00:00
Alexandre Poirot acb64f5211 Bug 1791969 - [devtools] Migrate lazyRequireGetter for JSM to ChromeUtils.defineModuleGetter. r=jdescottes
There was some imports of sys.mjs which I migrated to `ChromeUtils.defineESModuleGetters`.

Differential Revision: https://phabricator.services.mozilla.com/D158129
2022-09-28 16:20:08 +00:00
Alexandre Poirot 58b38d7c16 Bug 1791969 - [devtools] Import all JSM in DevTools via ChromeUtils.import. r=jdescottes
Convert all imports but the one related to SessionDataHelper
as that's an hybrid module which is loaded as a JSM from the main thread,
but loaded as a common js module from the worker thread.

We will be able to drop this once we can migrate this JSM to ESM
once we support loading ESM from the worker thread.

Differential Revision: https://phabricator.services.mozilla.com/D158007
2022-09-26 13:01:33 +00:00
Alexandre Poirot 94fbe736c2 Bug 1791828 - [devtools] Remove devtools lazyImporter in favor of ChromeUtils.defineModuleGetter. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D157910
2022-09-26 10:48:04 +00:00
Ted Campbell 7eb7d39c99 Bug 1790912 - Use globalThis instead of this with jsdebugger.jsm. r=jandem,ochameau
Use 'globalThis' instead of 'this' when trying to attach a debugger to the
current global to avoid subtle footguns with the varied definitions of 'this'.
The debugger interface needs a true GlobalObject so this is much clearer. In
particular, this is a problem in test_nativewrappers.js when the test runs in
strict mode since the 'this' in the test function is no long implicitly the
global.

Differential Revision: https://phabricator.services.mozilla.com/D157544
2022-09-25 09:03:33 +00:00
Alexandre Poirot 52cc15a830 Bug 1791055 - [devtools] Migrate to CommandsFactory to instantiate all descriptors. r=jdescottes,perftest-reviewers,AlexandruIonescu
This help factorise all code trying to instantiate a server and a client everywhere.
This will also help migrate from descriptor to commands in Toolbox constructor.

A good way to track all leftover manual instantiation of descriptors is to look for mainRoot.get*.
There should only be tests now, and descriptor-from-url, which I would to convert once
we migrate toolbox constructor from descriptor to commands.

Differential Revision: https://phabricator.services.mozilla.com/D157737
2022-09-24 07:14:58 +00:00
Alexandre Poirot 0c4e317914 Bug 1789980 - [devtools] Migrate all callsites using require("chrome") to use Components.* global symbols. r=jdescottes,perftest-reviewers,AlexandruIonescu
This will help transition to ES Modules as we won't be able to expose a magic "chrome" ESM.
Also, most of these symbols are exposed as global already.
All but:
* `components` which is `Components`,
* `CC` which is `Components.Constructor`,
* `Cm` which is `Components.manager`.

$ sed -ie "/require(.chrome.)/d" $(git grep -l 'require("chrome")' devtools/)
+ manual edits for all three exceptions

Differential Revision: https://phabricator.services.mozilla.com/D156936
2022-09-20 12:52:27 +00:00