Commit Graph
5249 Commits
Author SHA1 Message Date
Cristian Tuns d0272b92b7 Backed out 8 changesets (bug 1651518, bug 1883847) dt failures in nsTArray.h. CLOSED TREE
Backed out changeset 481558275c1d (bug 1651518)
Backed out changeset 5337435e8bca (bug 1651518)
Backed out changeset 8fe0c1a4da7f (bug 1651518)
Backed out changeset 840a0d9db260 (bug 1651518)
Backed out changeset eaab9de5819d (bug 1651518)
Backed out changeset cf71de92d782 (bug 1651518)
Backed out changeset d778691464db (bug 1651518)
Backed out changeset af28e5f719e8 (bug 1883847)
2024-05-22 09:02:19 -04:00
Alexandre Poirot 76d52e829a Bug 1651518 - [devtools] Enable server side worker targets for browser toolbox. r=devtools-reviewers,nchevobbe
Note that the ignore code for subprocess is being ported from the legacy worker watcher.

The Worker Target URL is now correctly set to the Absolute URL,
this has an impact on the context selector as we are displaying it.

Also, this patch highlights some issues around Common JS Loader and the distinct compartment
to be used when debugging privileged page, or when running the browser toolbox.
It caused leaks when running browser toolbox tests in debug builds.
The JS Process Actor is directly loaded in a distinct global and compartment "DevTools global",
thanks to `loadInDevToolsLoader` flag of BrowserToolboxDevToolsProcess JS Process Actor configuration.
There is no need to use `useDistinctSystemPrincipalLoader` helper as Loader.sys.mjs, loaded from
the JS Process Actor will also be loaded in the distinct global.
Then, we only need to ensure that the CommonJS Loader will also pick up the "DevTools global"
when it is loaded in that distinct global.
Things will be significantly easier once we migrate from CommonJS to ESM as the `{ global: "contextual" }`
option passed to `ChromeUtils.importESModule` will do the right thing, as well as static `import` statements.

Differential Revision: https://phabricator.services.mozilla.com/D204874
2024-05-22 11:50:45 +00:00
Alexandre Poirot 34e5032104 Bug 1651518 - [devtools] Ensure spawning DistinctSystemPrincipalLoader.sys.mjs only once. r=devtools-reviewers,nchevobbe
This is important to spawn this ESM only once between regular and browser toolbox,
and especially between various callsites used by the browser toolbox.
Otherwise we may start loading modules in two distinct system loaders
and may have inconsistancies when using `instanceof`.

Differential Revision: https://phabricator.services.mozilla.com/D207432
2024-05-22 11:50:44 +00:00
Alexandre Poirot b7ce0e5088 Bug 1651518 - [devtools] ResourceCommand.watchResources should be protected from mutation made to its array argument. r=devtools-reviewers,nchevobbe
Modifying the content of the list of resources may suddently start or stop receiving new resources types,
that, without calling (un)watchResources again!

Differential Revision: https://phabricator.services.mozilla.com/D205603
2024-05-22 11:50:43 +00:00
Cristina Horotan ca70119cfa Backed out 8 changesets (bug 1651518, bug 1883847) for causing damp failures at toolbox/browser-toolbox.js CLOSED TREE
Backed out changeset 4ec70db12f48 (bug 1651518)
Backed out changeset b2b138889ad6 (bug 1651518)
Backed out changeset efda5c09b0ea (bug 1651518)
Backed out changeset b0de4113f8fb (bug 1651518)
Backed out changeset 03cf235d2a80 (bug 1651518)
Backed out changeset 58e71c27f1fd (bug 1651518)
Backed out changeset f7fb390c3965 (bug 1651518)
Backed out changeset b8a2473c47c0 (bug 1883847)
2024-05-22 04:00:53 +03:00
Alexandre Poirot 64b2f242bc Bug 1651518 - [devtools] Enable server side worker targets for browser toolbox. r=devtools-reviewers,nchevobbe
Note that the ignore code for subprocess is being ported from the legacy worker watcher.

Also, this patch highlights some issues around Common JS Loader and the distinct compartment
to be used when debugging privileged page, or when running the browser toolbox.
It caused leaks when running browser toolbox tests in debug builds.
The JS Process Actor is directly loaded in a distinct global and compartment "DevTools global",
thanks to `loadInDevToolsLoader` flag of BrowserToolboxDevToolsProcess JS Process Actor configuration.
There is no need to use `useDistinctSystemPrincipalLoader` helper as Loader.sys.mjs, loaded from
the JS Process Actor will also be loaded in the distinct global.
Then, we only need to ensure that the CommonJS Loader will also pick up the "DevTools global"
when it is loaded in that distinct global.
Things will be significantly easier once we migrate from CommonJS to ESM as the `{ global: "contextual" }`
option passed to `ChromeUtils.importESModule` will do the right thing, as well as static `import` statements.

Differential Revision: https://phabricator.services.mozilla.com/D204874
2024-05-21 14:09:35 +00:00
Alexandre Poirot 3d2406db93 Bug 1651518 - [devtools] Ensure spawning DistinctSystemPrincipalLoader.sys.mjs only once. r=devtools-reviewers,nchevobbe
This is important to spawn this ESM only once between regular and browser toolbox,
and especially between various callsites used by the browser toolbox.
Otherwise we may start loading modules in two distinct system loaders
and may have inconsistancies when using `instanceof`.

Differential Revision: https://phabricator.services.mozilla.com/D207432
2024-05-21 14:09:33 +00:00
Alexandre Poirot 6fa21b8235 Bug 1651518 - [devtools] ResourceCommand.watchResources should be protected from mutation made to its array argument. r=devtools-reviewers,nchevobbe
Modifying the content of the list of resources may suddently start or stop receiving new resources types,
that, without calling (un)watchResources again!

Differential Revision: https://phabricator.services.mozilla.com/D205603
2024-05-21 14:09:33 +00:00
Alexandre Poirot b062cd5868 Bug 1874227 - [devtools] Fix browser_resources_sources.js permafail. r=devtools-reviewers,nchevobbe
The DOM Timer source is now correctly resurrected.
And the unique call to forceGC was a source of intermittent.

Differential Revision: https://phabricator.services.mozilla.com/D210911
2024-05-20 16:03:26 +00:00
Alexandre Poirot 4f32ffa373 Bug 1778803 - [devtools] Fix browser_target_command_scope_flag.js intermittent. r=devtools-reviewers,nchevobbe
It is always tricky to test the Browser Toolbox codepaths as you may have various targets
related to previous test/tasks which are being destroyed in middle of the test.
Here some target related to previous task were removed in middle of this assertion.

It is better to test for actual deterministic content we are expecting rather than counting targets.

Differential Revision: https://phabricator.services.mozilla.com/D210668
2024-05-16 16:55:56 +00:00
Rob Wu 9ee4da4349 Bug 1865689 - Add test case for view-source in devtools r=rpl,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D196134
2024-05-16 14:46:57 +00:00
Alexandre Poirot 5506678bac Bug 1896592 - [devtools] Better handle file:// requests. r=devtools-reviewers,bomsy
Error were thrown when trying to fetch headers and cookies, which was preventing inspecting them fully.

Fixing that, enable seeing about:neterror requests which were trigerring a file:// URI request (at least on local builds).
So that we now have to explicitly ignore these error requests.

Differential Revision: https://phabricator.services.mozilla.com/D210319
2024-05-16 08:30:22 +00:00
Henrik Skupin ddfe85001c Bug 1892248 - [devtools] Update compatibility data for Firefox 127. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D209323
2024-05-03 07:29:33 +00:00
Valentin Gosu 98348bede1 Bug 1883693 - Fix devtools expectation that newChannel throws for unsupported external handlers r=nika,devtools-reviewers,ochameau
Depends on D205296

Differential Revision: https://phabricator.services.mozilla.com/D206754
2024-05-02 18:11:52 +00:00
Sandor Molnar 2b94563f8d Backed out 2 changesets (bug 1883693) for causing xpc failures @ test_fetch-file.js CLOSED TREE
Backed out changeset 4f9f5e9c42f8 (bug 1883693)
Backed out changeset 4e8e200c3599 (bug 1883693)
2024-05-01 04:08:52 +03:00
Valentin Gosu b86f770439 Bug 1883693 - Fix devtools expectation that newChannel throws for unsupported external handlers r=nika,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D206754
2024-04-30 20:19:05 +00:00
Nicolas Chevobbe 8384623980 Bug 1892901 - [devtools] Remove performEOFFixup preserveBackslash parameter. r=devtools-reviewers,bomsy.
The parameter was always passed with true,
except in a unit test.

Differential Revision: https://phabricator.services.mozilla.com/D208320
2024-04-30 05:12:54 +00:00
Nicolas Chevobbe 141dde3782 Bug 1892897 - [devtools] Re-enable camelcase eslint rule in devtools/shared/css/lexer.js. r=devtools-reviewers,bomsy.
Depends on D208318

Differential Revision: https://phabricator.services.mozilla.com/D208319
2024-04-30 05:12:54 +00:00
dylan a202f7dcaf Bug 1891610 - added zstd support to devtools. r=jesup,bomsy,necko-reviewers,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D207490
2024-04-30 04:50:01 +00:00
Stanca Serban 6b85455896 Backed out 2 changesets (bug 1883693) for causing wpt failures in same-origin.html.
Backed out changeset 56770cf9b51a (bug 1883693)
Backed out changeset 8958ecbeec9e (bug 1883693)
2024-04-28 22:59:20 +03:00
Valentin Gosu a02a205ed3 Bug 1883693 - Fix devtools expectation that newChannel throws for unsupported external handlers r=nika,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D206754
2024-04-28 16:21:28 +00:00
Nicolas Chevobbe 5532aef13b Bug 1892895 - [devtools] Remove JS CSS Lexer. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D208318
2024-04-26 09:18:12 +00:00
Alexandre Poirot 34aa93afd2 Bug 1887852 - [devtools] Avoid throwing on request done late during document unload. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D207967
2024-04-25 09:48:48 +00:00
Natalia Csoregi e2e3d72e0a Backed out 2 changesets (bug 1883693) for causing bustage on nsExternalProtocolHandler.cpp. CLOSED TREE
Backed out changeset 5b0d6bb6f378 (bug 1883693)
Backed out changeset 1a96a3723839 (bug 1883693)
2024-04-25 13:04:43 +03:00
Valentin Gosu 1bf3284c1f Bug 1883693 - Fix devtools expectation that newChannel throws for unsupported external handlers r=nika,devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D206754
2024-04-25 09:06:56 +00:00
Nicolas Chevobbe de4ffa55e6 Bug 1888607 - [devtools] Use InspectorCSSParser in parseDeclarationsInternal. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D206092
2024-04-23 08:43:03 +00:00
Nicolas Chevobbe 0abfb7c1f9 Bug 1889363 - [devtools] Implement performEOFFixup for InspectorCSSParser. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D206748
2024-04-23 08:43:03 +00:00
Jari Jalkanen d9d826bec3 Bug 1890730 - Fix IDBFactory deleteDatabase to not use IDBOpenDBOptions. r=dom-storage-reviewers,webidl,smaug,asuth
Differential Revision: https://phabricator.services.mozilla.com/D207168
2024-04-22 04:46:59 +00:00
Jari Jalkanen a461bd344a Bug 1275496 - Change existing uses of custom IDBFactory.open to the standard overload. r=dom-storage-reviewers,home-newtab-reviewers,janv,thecount
Differential Revision: https://phabricator.services.mozilla.com/D38295
2024-04-22 04:46:58 +00:00
Nicolas Chevobbe ca57e329c5 Bug 1888441 - [devtools] Use InspectorCSSParser in CSSCompleter. r=devtools-reviewers,bomsy.
This requires some changes as the token type and text from the cssparser
differs from the JS-based CSS lexer.

Differential Revision: https://phabricator.services.mozilla.com/D206023
2024-04-17 05:57:13 +00:00
Nicolas Chevobbe c7b54bcdaa Bug 1888609 - [devtools] Use InspectorCSSParser in prettifyCSS. r=devtools-reviewers,bomsy.
We're exposing the parser current lineNumber and columnNumber in InspectorCSSParserWrapper

Differential Revision: https://phabricator.services.mozilla.com/D206093
2024-04-16 12:11:59 +00:00
Nicolas Chevobbe 495bf67752 Bug 1888353 - [devtools] Use InspectorCSSParser in parsePseudoClassesAndAttributes. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D205981
2024-04-16 12:11:58 +00:00
Aron Cseh 12dda8a2c9 Backed out 5 changesets (bug 1888615, bug 1889871, bug 1888609, bug 1888353, bug 1888363) for causing dt failures on browser_webconsole_location_styleeditor_link.js CLOSED TREE
Backed out changeset ef8e96126716 (bug 1889871)
Backed out changeset a68f24368621 (bug 1888615)
Backed out changeset 1783cd63d2c4 (bug 1888609)
Backed out changeset 62333a10235e (bug 1888363)
Backed out changeset 03888776c90d (bug 1888353)
2024-04-16 13:18:32 +03:00
Nicolas Chevobbe 884f1580a9 Bug 1888609 - [devtools] Use InspectorCSSParser in prettifyCSS. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D206093
2024-04-16 07:39:36 +00:00
Nicolas Chevobbe ecd62534da Bug 1888353 - [devtools] Use InspectorCSSParser in parsePseudoClassesAndAttributes. r=devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D205981
2024-04-16 07:39:35 +00:00
Nicolas Chevobbe 46f2af8bba Bug 1887638 - [devtools] Expose CSS token value in InspectorCSSToken. r=emilio.
In some cases, it can be more useful to only get the token value than the whole
token text (e.g. for 'Function`, where the value is the function name, while
the text includes the opening parenthesis)
Refactor `test_lexer` to better test the tokens we get, including their value property.

Differential Revision: https://phabricator.services.mozilla.com/D207400
2024-04-15 17:14:43 +00:00
Nicolas Chevobbe 8609258f9f Bug 1887638 - [devtools] Add InspectorCSSParser. r=emilio,devtools-reviewers,frontend-codestyle-reviewers,bomsy.
This new InspectorCSSParser makes use of the cssparser crate so DevTools end
up using the same code as the CSS engine.
At the moment, we can't get the token start and end offsets, so we create
a JS wrapper class to compute them in JS. This might be removed if we get
a way to retrieve utf16 position from the cssparser.
The existing lexer xpcshell test is modified so it can run against both js-based
and rust-based lexers.

Differential Revision: https://phabricator.services.mozilla.com/D202909
2024-04-15 17:14:42 +00:00
Hubert Boma Manilla 7fc5dd4445 Bug 1767770 - [devtools] On content page load image requests are loaded r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D176310
2024-04-11 08:43:17 +00:00
Julian Descottes 92fe11e5c6 Bug 1890712 - [devtools] Update MDN compat data (5.5.20). r=devtools-reviewers,bomsy
Differential Revision: https://phabricator.services.mozilla.com/D207107
2024-04-10 08:47:47 +00:00
Yi Xiong Wong bef11a2dc2 Bug 1880914 - Move browser/tab closing functions. r=Gijs,perftest-reviewers,devtools-reviewers,fxview-reviewers,sessionstore-reviewers,sfoster,kshampur
Differential Revision: https://phabricator.services.mozilla.com/D206197
2024-04-08 17:21:01 +00:00
Mark Banner d79c6960e4 Bug 1889087 - Enable ESLint rule mozilla/reject-chromeutils-import on devtools as well. r=arai,devtools-reviewers,profiler-reviewers,julienw,frontend-codestyle-reviewers,perftest-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D206349
2024-04-06 09:08:47 +00:00
Sandor Molnar 890280e412 Backed out changeset 50f86f169ee8 (bug 1889087) for causing talos performance test failures CLOSED TREE 2024-04-03 09:18:07 +03:00
Mark Banner 8b11d372f2 Bug 1889087 - Enable ESLint rule mozilla/reject-chromeutils-import on devtools as well. r=arai,devtools-reviewers,profiler-reviewers,julienw
Differential Revision: https://phabricator.services.mozilla.com/D206349
2024-04-02 19:05:48 +00:00
Alexandre Poirot 6c428aaabd Bug 1866814 - [devtools] Merge all DevTools JS Actors into a single DOM Process JS Actor. r=devtools-reviewers,nchevobbe
* The formers JSWindow Actors used independently to create Target Actor for WindowGlobals, Web workers and Service workers
  are all unified behind a single JSProcess Actor pair which was only used to create target actors for DOM Content Processes.
* The DevToolsProcess JSProcess actor now actively monitor the currently watched target types
  in order to start and stop listeners specific to each target type.
  We no longer rely on JSWindow Actors to observe WindowGlobal instantiations.

* `watchedByDevTools` is now consistantly set from each WindowGlobal's content process, via the WindowGlobalTargetActor.
  With the new setup, the parent process no longer track WindowGlobal/BrowsingContext's and so there is no
  natural place to flag them. While, in the content process, the target actor is an obvious place.
  There is just one trick in window global target watcher in order to also set this flag on initial about blank documents.

* `browser-element-host` Session Data is now slightly more simple. It works like any other similar session data attribute.
  But we have to ignore any pending exception coming up from updateDomainSessionDataForServiceWorkers call as that be still pending
  while the toolbox closes, which make the JS Process Actor be unregistered,
  and ultimately make the underlying sendQuery promise be rejected.
* The `loader` is made specific to each Watcher/connection and put in the connections map,
  so that we can better support content toolbox & browser toolbox usecases
  and we have a unique place to define the loader per watcher/connection.

* browser_target_command_detach.js: detach is no longer enough. It wouldn't stop watching and prevent the re-instantiation
  of the target actor. We now have to stop watching for targets. This actually better match what happens on toolbox closing.
  This test was meant as a unit test for covering remote debugging reusing the same DevToolsClient for debugger the same tab.
* `browser_toolbox_watchedByDevTools`. The management of watchedByDevTools is now driven from the content process.
  And because the DevTools Server and especially the watcher actor is destroyed without an explicit RDP request
  that the toolbox destruction is waiting for, we can't rely on closeToolbox to know
  when the server is fully cleaned up.

Differential Revision: https://phabricator.services.mozilla.com/D203409
2024-04-02 08:54:51 +00:00
Alexandre Poirot d7f3cddc7f Bug 1888171 - [devtools] Convert Browser Loader to ESM. r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Differential Revision: https://phabricator.services.mozilla.com/D205867
2024-03-28 15:15:24 +00:00
Alexandre Poirot 85bd68b0ae Bug 1888171 - [devtools] Rename worker helper module to ESM. r=devtools-reviewers,nchevobbe
Git isn't able to detect the file being only renamed in the previous changeset
as the changes made to it are too important.
So, use a distinct changeset to apply the file rename.

Differential Revision: https://phabricator.services.mozilla.com/D205988
2024-03-28 15:15:23 +00:00
Alexandre Poirot a44f110542 Bug 1888171 - [devtools] Convert worker helper module to ESM. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D205866
2024-03-28 15:15:23 +00:00
Alexandre Poirot f74f2467f4 Bug 1888171 - [devtools] Convert worker loader module to ESM. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D205865
2024-03-28 15:15:22 +00:00
Cristian Tuns db7b2a330c Backed out 3 changesets (bug 1866814) for causing bc failures browser_ext_devtools_inspectedWindow_targetSwitch.js CLOSED TREE
Backed out changeset 5d59dd808307 (bug 1866814)
Backed out changeset f503f5d02d1e (bug 1866814)
Backed out changeset d27f783be149 (bug 1866814)
2024-03-28 08:37:11 -04:00
Alexandre Poirot ee299a8d02 Bug 1866814 - [devtools] Merge all DevTools JS Actors into a single DOM Process JS Actor. r=devtools-reviewers,nchevobbe
* The formers JSWindow Actors used independently to create Target Actor for WindowGlobals, Web workers and Service workers
  are all unified behind a single JSProcess Actor pair which was only used to create target actors for DOM Content Processes.
* The DevToolsProcess JSProcess actor now actively monitor the currently watched target types
  in order to start and stop listeners specific to each target type.
  We no longer rely on JSWindow Actors to observe WindowGlobal instantiations.

* `watchedByDevTools` is now consistantly set from each WindowGlobal's content process, via the WindowGlobalTargetActor.
  With the new setup, the parent process no longer track WindowGlobal/BrowsingContext's and so there is no
  natural place to flag them. While, in the content process, the target actor is an obvious place.
  There is just one trick in window global target watcher in order to also set this flag on initial about blank documents.

* `browser-element-host` Session Data is now slightly more simple. It works like any other similar session data attribute.
  But we have to ignore any pending exception coming up from updateDomainSessionDataForServiceWorkers call as that be still pending
  while the toolbox closes, which make the JS Process Actor be unregistered,
  and ultimately make the underlying sendQuery promise be rejected.
* The `loader` is made specific to each Watcher/connection and put in the connections map,
  so that we can better support content toolbox & browser toolbox usecases
  and we have a unique place to define the loader per watcher/connection.

* browser_target_command_detach.js: detach is no longer enough. It wouldn't stop watching and prevent the re-instantiation
  of the target actor. We now have to stop watching for targets. This actually better match what happens on toolbox closing.
  This test was meant as a unit test for covering remote debugging reusing the same DevToolsClient for debugger the same tab.
* `browser_toolbox_watchedByDevTools`. The management of watchedByDevTools is now driven from the content process.
  And because the DevTools Server and especially the watcher actor is destroyed without an explicit RDP request
  that the toolbox destruction is waiting for, we can't rely on closeToolbox to know
  when the server is fully cleaned up.

Differential Revision: https://phabricator.services.mozilla.com/D203409
2024-03-28 10:47:17 +00:00