Commit Graph
397 Commits
Author SHA1 Message Date
Alexandre Poirot 26d9f9bb91 Bug 1713093 - [devtools] Remove TargetMixin.attachThread. r=devtools-reviewers,nchevobbe
This code was only used for workers targets, which weren't passing breakpoints
from the server side via "sessionData" concept.
Instead, we were still relying on the frontend to pass them and only after that
manually requesting the thread to resume its execution.

Now, there is still a notion of "attach" around the thread actor.
While all the targets are immediately instantiating their related thread actor,
the thread actor isn't active by default.
It becomes active as soon as:
* SOURCE or THREAD_STATE resource is watched
* breakpoints are set via session data (breakpoint list actor)
* thread configuration are set via session data (thread configuration actor)
I had to do one of these things in order to keep test from working.
In the production code, we do most of these things by default on the toolbox startup.
We could revise this behavior by:
* always attaching the thread actor, but it may start pausing unexpectedly in some tests.
* decouple sources from breakpoints within the thread actor, so that watching for sources doesn't necessarily "attach" the thread actor and activate breakpoints/debugger statements.
* have a new thread configuration to explicitly enable the thread actor pausing features.

I'm often using thread configuration to enable pausing in tests.
This required to improve xpcshell test helpers to be able to use Watcher/Commands.

About browser_target_command_bfcache.js, the DevTools code is now so quick that the
back/forward requests at done too quickly one after the other and fail actually moving to
the other document.

Differential Revision: https://phabricator.services.mozilla.com/D166321
2024-03-20 12:30:17 +00:00
Nicolas Chevobbe adffa997c1 Bug 1698260 - [devtools] Fix autocomplete for Infinity. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D204478
2024-03-15 05:59:56 +00:00
pstanciu 5a1a45a9a8 Backed out 6 changesets (bug 1713093, bug 1691986) for turning Bug 1767717 into permafail. CLOSED TREE
Backed out changeset b0285f8abf2e (bug 1713093)
Backed out changeset 6532dbabf879 (bug 1713093)
Backed out changeset 2670f26f6bff (bug 1713093)
Backed out changeset a63d603a1973 (bug 1713093)
Backed out changeset 0118d0bc64ba (bug 1713093)
Backed out changeset e29a81bc7299 (bug 1691986)
2024-03-08 20:32:38 +02:00
Alexandre Poirot 9f0c59245f Bug 1713093 - [devtools] Remove TargetMixin.attachThread. r=devtools-reviewers,nchevobbe
This code was only used for workers targets, which weren't passing breakpoints
from the server side via "sessionData" concept.
Instead, we were still relying on the frontend to pass them and only after that
manually requesting the thread to resume its execution.

Now, there is still a notion of "attach" around the thread actor.
While all the targets are immediately instantiating their related thread actor,
the thread actor isn't active by default.
It becomes active as soon as:
* SOURCE or THREAD_STATE resource is watched
* breakpoints are set via session data (breakpoint list actor)
* thread configuration are set via session data (thread configuration actor)
I had to do one of these things in order to keep test from working.
In the production code, we do most of these things by default on the toolbox startup.
We could revise this behavior by:
* always attaching the thread actor, but it may start pausing unexpectedly in some tests.
* decouple sources from breakpoints within the thread actor, so that watching for sources doesn't necessarily "attach" the thread actor and activate breakpoints/debugger statements.
* have a new thread configuration to explicitly enable the thread actor pausing features.

I'm often using thread configuration to enable pausing in tests.
This required to improve xpcshell test helpers to be able to use Watcher/Commands.

About browser_target_command_bfcache.js, the DevTools code is now so quick that the
back/forward requests at done too quickly one after the other and fail actually moving to
the other document.

Differential Revision: https://phabricator.services.mozilla.com/D166321
2024-03-06 13:43:48 +00:00
Dave Townsend 2af4d349f3 Bug 1864896: Autofix unused function arguments (devtools). r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Differential Revision: https://phabricator.services.mozilla.com/D202959
2024-03-05 14:21:15 +00:00
Gijs Kruitbosch 3288f177a4 Bug 1780071 - autofix devtools/ violations of no-comparison-or-assignment-inside-ok r=profiler-reviewers,devtools-reviewers,julienw,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D198975
2024-01-26 13:12:07 +00:00
Nicolas Chevobbe 5a608228ab Bug 1872689 - [devtools] Prepare codebase for eslint-plugin-react update. r=devtools-reviewers,ochameau.
Updating eslint-plugin-react to 7.33.2 raises new eslint errors.
A few component needed to have their proptypes fixed (or added).
JSPropertyProvider was considered as a react component by the plugin,
I guess because it is a function starting with an uppercase letter.
Since it is a bit unusual to have such thing, I renamed it slightly
to make it look more like a function.

Differential Revision: https://phabricator.services.mozilla.com/D197596
2024-01-04 16:06:08 +00:00
Alexandre Poirot faf55b5e07 Bug 1616524 - [devtools] Allow side effect free console commands to be called in eager evaluation. r=devtools-reviewers,nchevobbe
For now, only console command values like $0, $_ and $x were allowed in eager evaluation,
only by luck as these commands were evaluated and cached *before* Frame.evalWithBinding and Object.executeInGlobalWithBindings
started running the console input string.

But methods were cancelled by onNativeCall. This new isSideEffectFree flag allows to identify these methods.

Differential Revision: https://phabricator.services.mozilla.com/D195022
2023-12-02 08:07:15 +00:00
Alexandre Poirot f47ac5b3fe Bug 1830915 - [devtools] Introduce a generic mechanism to print web console command usage. r=devtools-reviewers,nchevobbe,flod,fluent-reviewers
We can start printing usage description right into the console by using `:command --help` or `:command --usage`.

I also simplified the integration between eval-with-debugger and manager
in order to fully delegate command execution to the manager.

Also improved the jsdoc for the register method. This new feature will be covered by test in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D193272
2023-11-24 14:02:16 +00:00
Joel Maher cac31d18e3 Bug 1859873 - batch 13 xpcshell.ini -> .toml. r=aryx,devtools-reviewers,profiler-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D194161
2023-11-21 12:32:50 +00:00
Alexandre Poirot 1955b12acf Bug 1863512 - Disable tests using SharedArrayBuffer on release/beta. r=devtools-reviewers,nchevobbe
SharedArrayBuffer can only easily be testing through dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled
preference which is locked on beta and release channels.

Differential Revision: https://phabricator.services.mozilla.com/D192942
2023-11-08 17:33:54 +00:00
Alexandre Poirot dbc1747b07 Bug 1860888 - [devtools] Fix logging SharedArrayBuffer from Worklet/Workers. r=devtools-reviewers,smaug
This custom CloneDataPolicy was already using while writing the structured clone,
but not when reading it.

Differential Revision: https://phabricator.services.mozilla.com/D191783
2023-11-06 14:42:52 +00:00
Stanca Serban 9c3f5b4c85 Backed out changeset 4492a1a7f6e7 (bug 1860888) for causing mochitests failures in test_console_serviceworker_cached.html. CLOSED TREE 2023-11-03 12:46:25 +02:00
Alexandre Poirot 0385bcb81d Bug 1860888 - [devtools] Fix logging SharedArrayBuffer from Worklet/Workers. r=devtools-reviewers,smaug
This custom CloneDataPolicy was already using while writing the structured clone,
but not when reading it.

Differential Revision: https://phabricator.services.mozilla.com/D191783
2023-11-03 09:39:41 +00:00
Tom Marble 6c1231e2e8 Bug 1853244 - convert .ini manifests to .toml: batch 6 {caps,devtools,dom}/**/browser.ini r=jmaher,media-playback-reviewers,devtools-reviewers,profiler-reviewers,alwu,nchevobbe,canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D188856
2023-09-22 20:42:14 +00:00
Tom Marble d70780c99c Bug 1850545 - convert .ini manifests to .toml: batch 3 chrome.ini (bis) r=jmaher,geckoview-reviewers,extension-reviewers,credential-management-reviewers,devtools-reviewers,fxview-reviewers,places-reviewers,profiler-reviewers,m_kato,mak,mtigley
Differential Revision: https://phabricator.services.mozilla.com/D187597
2023-09-13 18:28:32 +00:00
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
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
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
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
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
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
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
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 0f32f335e3 Bug 1789201 - [devtools] Expose Services as a global to all DevTools modules. r=perftest-reviewers,nchevobbe,julienw,AlexandruIonescu
This will help transition to ES Modules as this symbol is exposed to them.

$ sed -ie "/require(.Services.)/d" $(git grep -l 'require("Services")' devtools/)
$ sed -ie "/loader.lazyRequireGetter(this, .Services./d" $(git grep -l 'loader.lazyRequireGetter(this, "Services"' devtools/)
+ the edition of builtin-modules.js + eslintrc.js
+ manual eslint fixes
+ removal of devtools-services in the debugger, except for jest tests

Differential Revision: https://phabricator.services.mozilla.com/D156401
2022-09-09 07:22:51 +00:00
nchevobbe 1d3b1527c4 Bug 1483662 - [devtools] Use microSecondTimeStamp to build timeStamp for console-related resources. r=jdescottes.
We can get a higher precision timestamp from microSecondTimeStamp, which will be consumed
in the console client to re-order messages.
This fixes an issue where different type of resources (console-messages and error-messages)
emitted during the same timestamp would not appear in the order they should be in.
A test is added to make sure the fix is effective.

Differential Revision: https://phabricator.services.mozilla.com/D155546
2022-09-02 04:58:28 +00:00
Mark Banner 3387a89bc7 Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for devtools. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D155167
2022-08-26 13:39:34 +00:00
Mark Banner 6d03c63e2d Bug 1330099 - Enable object-shorthand eslint rule. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D153567
2022-08-03 14:57:05 +00:00
Mark Banner 1e3410cbdd Bug 1782008 - Remove now unnecessary .eslintrc.js files. r=webcompat-reviewers,extension-reviewers,media-playback-reviewers,pip-reviewers,denschub,rpl,alwu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D152736
2022-08-03 11:16:20 +00:00
Michael Ratcliffe 690d84ee0f Bug 1772718 - Reduce mozilla/reject-scriptableunicodeconverter eslint warnings in DevTools code r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D148346
2022-06-16 18:24:17 +00:00
Alexandre Poirot d7d9fe0799 Bug 1770130 - [devtools] Get rid of WorkerDescriptorActor.attach. r=nchevobbe,devtools-backward-compat-reviewers
We can immediately "attach" the descriptor as it gets instantiated.
So that the frontend no longer need to call this before doing anything around the worker.

I also renamed the descriptor front method "attach" method,
in order to better highlight how special it is.
Hopefully we can drop this once the worker targets are created by the server.
i.e. when we enable service side worker targets for the browser toolbox,
which includes supporting service workers.

Differential Revision: https://phabricator.services.mozilla.com/D146787
2022-05-23 08:38:01 +00:00