Commit Graph
3614 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 2ca6803e58 Bug 1651518 - [devtools] Ensure waiting for CSS Warning full listening when toggling the filter from tests. r=devtools-reviewers,nchevobbe
The enhancer was brittle as nothing was waiting for its completion.
We should rather do such work from the action layer. At least this can delay the action completion,
which the test header (setFilterState) already wait for.

Differential Revision: https://phabricator.services.mozilla.com/D205602
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 77d5f78f48 Bug 1651518 - [devtools] Ensure waiting for CSS Warning full listening when toggling the filter from tests. r=devtools-reviewers,nchevobbe
The enhancer was brittle as nothing was waiting for its completion.
We should rather do such work from the action layer. At least this can delay the action completion,
which the test header (setFilterState) already wait for.

Differential Revision: https://phabricator.services.mozilla.com/D205602
2024-05-21 14:09:33 +00:00
Nicolas Chevobbe e39b6ccdc1 Bug 1897139 - [devtools] Share blocked request string between console and netmonitor. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D210649
2024-05-17 07:42:17 +00:00
Nicolas Chevobbe e58349d131 Bug 1895536 - [devtools] Update network request blocked string. r=devtools-reviewers,ochameau.
Requests can be blocked because of many reasons, but the label was always
saying it was because of DevTools.
Update the label so we follow what's done in Netmonitor.

Differential Revision: https://phabricator.services.mozilla.com/D210471
2024-05-16 12:40:22 +00:00
Nicolas Chevobbe 468323a509 Bug 1888645 - [devtools] Fix SmartTrace crash with wasm frames. r=devtools-reviewers,bomsy.
In some cases, we were getting null sourceId, which was causing an exception
to be thrown in `getFormattedSourceId` since it expects a string.
We add a simple guard in this function so we don't throw anymore.

But we shouldn't get null sourceId in the first place. It looks like for
some Wasm sources, the SavedFrame sourceId can be 0, which wasn't playing
well with some loose check we were doing in the sources manager.

Finally, the "Copy metadata" button we display when a console message crash
wasn't working. The message now includes the targetFront, which can be serialized
in JSON, so we simply ignore it.

Differential Revision: https://phabricator.services.mozilla.com/D206105
2024-05-13 10:17:15 +00:00
Tooru Fujisawa 93e31d8b1f Bug 1893611 - Add shouldAvoidSideEffects debugger flag and use it in Services resolve hook. r=iain,devtools-reviewers,nchevobbe
In order to abort eager evaluation when executing a resolve hook with side-effect,
especially the Services' hook which imports ES module, which is not undo-able,
introduce a dedicate debugger flag to ask to avoid side-effectful operation in
the resolve hook.

Differential Revision: https://phabricator.services.mozilla.com/D208970
2024-05-08 10:56:39 +00:00
Stanca Serban e06a6821a9 Backed out changeset 797adb0dd49c (bug 1893611) for causing dt failures in browser_console_eager_eval_resolve.js. 2024-05-04 05:31:43 +03:00
Tooru Fujisawa 8202ca9760 Bug 1893611 - Add shouldAvoidSideEffects debugger flag and use it in Services resolve hook. r=iain,devtools-reviewers,nchevobbe
In order to abort eager evaluation when executing a resolve hook with side-effect,
especially the Services' hook which imports ES module, which is not undo-able,
introduce a dedicate debugger flag to ask to avoid side-effectful operation in
the resolve hook.

Differential Revision: https://phabricator.services.mozilla.com/D208970
2024-05-03 20:06:38 +00:00
Julian Descottes 1a81713270 Bug 1845037 - [devtools] Revert DevTools screenshots to use the default downloads directory r=devtools-reviewers,ochameau
Revert the DevTools bits from Bug 1072345 to be consistent with the Screenshots feature from Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D207413
2024-04-15 15:05:57 +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
Nicolas Chevobbe 07e635904f Bug 1767725 - [devtools] Bump timeout for browser_webconsole_cors_errors.js. r=devtools-reviewers,ochameau.
Also clear output between different "tests" so it's easier to debug in case of failure.

Differential Revision: https://phabricator.services.mozilla.com/D205816
2024-04-03 05:16:16 +00:00
Irene Ni ea6c87d4f9 Bug 1876432 - Added support for custom themes as its own menu in Reader View. r=reader-mode-reviewers,fluent-reviewers,desktop-theme-reviewers,hjones,accessibility-frontend-reviewers,bolsson,devtools-reviewers,sfoster,cmkm,jules,ayeddi
Differential Revision: https://phabricator.services.mozilla.com/D204519
2024-04-02 00:08:46 +00:00
Yi Xiong Wong af7f0d403b Bug 1880914 - Move all reload functions. r=Gijs,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D205527
2024-03-28 17:05:01 +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
artem manushenkov 0c607a8763 Bug 1731635 [devtools] Add option to disable split console r=nchevobbe,fluent-reviewers,devtools-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D204142
2024-03-27 06:34:50 +00:00
Alexandre Poirot 8c9338e858 Bug 1827382 - [devtools] Migrate tracer from JSM to ESM. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202437
2024-03-26 08:29:21 +00:00
Peter Van der Beken 7ed3ed283a Bug 1882127 - Use plain JS functions for WebIDL interface objects. r=saschanaz,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202824
2024-03-23 19:52:09 +00:00
Stanca Serban e7cf211803 Backed out 5 changesets (bug 1882127) for causing wpt failures in builtin-function-properties.any.html.
Backed out changeset c7c1e3e34508 (bug 1882127)
Backed out changeset 10710fd2c819 (bug 1882127)
Backed out changeset 3633dba5d35a (bug 1882127)
Backed out changeset 4d3e3b1fa2ba (bug 1882127)
Backed out changeset f537b9d36bb2 (bug 1882127)
2024-03-22 17:21:50 +02:00
Peter Van der Beken 6b0121dbbd Bug 1882127 - Use plain JS functions for WebIDL interface objects. r=saschanaz,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D202824
2024-03-22 11:32:17 +00:00
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
Emilio Cobos Álvarez 1c20c25eda Bug 232598 - Return null for unset attributes in XUL. r=smaug,devtools-reviewers,omc-reviewers,zombie,nchevobbe,settings-reviewers,application-update-reviewers,credential-management-reviewers,mossop,aminomancer,bytesized,issammani,sessionstore-reviewers,dao
I just got bit by this in bug 1873833, let's just fix it. There isn't
all that much stuff depending on it anymore.

Differential Revision: https://phabricator.services.mozilla.com/D204496
2024-03-18 09:15:07 +00:00
Nicolas Chevobbe d907b26b91 Bug 1862896 - [devtools] Preview support for CustomStateSet. r=devtools-reviewers,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D204597
2024-03-15 06:05:17 +00:00
Alexandre Poirot ac200fac8b Bug 1884717 - [devtools] Expose function returns logging to webconsole :trace command. r=devtools-reviewers,fluent-reviewers,flod,bomsy
This was only exposed via the Debugger button.

Differential Revision: https://phabricator.services.mozilla.com/D204302
2024-03-13 13:48:55 +00:00
Alexandre Poirot d22ddaa6e6 Bug 1884717 - [devtools] Only log "returns" when logging exit frames without tracing values. r=devtools-reviewers,bomsy
We were logging "returns undefined" everywhere.

Differential Revision: https://phabricator.services.mozilla.com/D204301
2024-03-13 13:48:54 +00:00
Tom Schuster cf5fe63b27 Bug 1848315 - CSP: Introduce new and more detailed error messages. r=freddyb,devtools-reviewers,flod
Differential Revision: https://phabricator.services.mozilla.com/D186143
2024-03-11 14:26:46 +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
Nicolas Chevobbe 57c4155db4 Bug 1883305 - [devtools] Remove 123 backward compatibility code. r=ochameau,devtools-reviewers.
Differential Revision: https://phabricator.services.mozilla.com/D203395
2024-03-04 14:20:53 +00:00
Iulian Moraru ef2ce63aea Backed out 4 changesets (bug 1848315) for causing multiple failures. CLOSED TREE
Backed out changeset b921bb1aee11 (bug 1848315)
Backed out changeset 0872a066e6fd (bug 1848315)
Backed out changeset 028e9468f0a3 (bug 1848315)
Backed out changeset b57c4274e7ab (bug 1848315)
2024-03-01 14:16:44 +02:00
Tom Schuster a3fa136925 Bug 1848315 - CSP: Introduce new and more detailed error messages. r=freddyb,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D186143
2024-03-01 10:59:11 +00:00
Gregory Pappas 9bd4fc9c87 Bug 1878401 - part 7 - Pass BrowsingContext to nsIFilePicker::Init in tests r=extension-reviewers,settings-reviewers,credential-management-reviewers,anti-tracking-reviewers,devtools-reviewers,sgalich,pbz,nchevobbe,zombie,migration-reviewers,mconley
Depends on D200551

Differential Revision: https://phabricator.services.mozilla.com/D200552
2024-02-28 21:29:39 +00:00
Gregory Pappas 67bf0fdf61 Bug 1878401 - part 4 - Update nsIFilePicker users in devtools/ to pass BrowsingContext to init r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Depends on D200548

Differential Revision: https://phabricator.services.mozilla.com/D200549
2024-02-28 21:29:38 +00:00
Sandor Molnar c853f2f3e9 Backed out 8 changesets (bug 1878401, bug 1879041) for causing build bustages on widget/nsBaseFilePicker.cpp CLOSED TREE
Backed out changeset 2e2b8df3bdd6 (bug 1879041)
Backed out changeset 6d6952f9df2c (bug 1878401)
Backed out changeset 30b5bb590d3e (bug 1878401)
Backed out changeset 9a4b830334b9 (bug 1878401)
Backed out changeset 3c3d67f1fcb7 (bug 1878401)
Backed out changeset c83ba4026822 (bug 1878401)
Backed out changeset 6bcb670ce475 (bug 1878401)
Backed out changeset f263b196df96 (bug 1878401)
2024-02-28 17:56:48 +02:00
Gregory Pappas 55e30a8b92 Bug 1878401 - part 7 - Pass BrowsingContext to nsIFilePicker::Init in tests r=extension-reviewers,settings-reviewers,credential-management-reviewers,anti-tracking-reviewers,devtools-reviewers,sgalich,pbz,nchevobbe,zombie,migration-reviewers,mconley
Depends on D200551

Differential Revision: https://phabricator.services.mozilla.com/D200552
2024-02-28 15:07:46 +00:00
Gregory Pappas 19820007ba Bug 1878401 - part 4 - Update nsIFilePicker users in devtools/ to pass BrowsingContext to init r=profiler-reviewers,devtools-reviewers,nchevobbe,julienw
Depends on D200548

Differential Revision: https://phabricator.services.mozilla.com/D200549
2024-02-28 15:07:45 +00:00
Sandor Molnar 30986017eb Backed out 4 changesets (bug 1848315) for causing browser_webconsole_csp_violation CLOSED TREE
Backed out changeset 7ef3e9f17105 (bug 1848315)
Backed out changeset 722163aa402f (bug 1848315)
Backed out changeset 2e823f3a6f99 (bug 1848315)
Backed out changeset 17f05d5f385d (bug 1848315)
2024-02-28 16:49:51 +02:00
Tom Schuster 7a04235408 Bug 1848315 - CSP: Introduce new and more detailed error messages. r=freddyb,devtools-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D186143
2024-02-28 13:54:54 +00:00
Alexandre Poirot 8fd4e3f6d4 Bug 1721427 - [devtools] Trace each step in a function call. r=devtools-reviewers,nchevobbe
This feature is only exposed to internal usages of tracer.jsm, by passing traceStep boolean option:
```
startTracing({ global, traceSteps: true });
```
This will automatically log to stdout all traces, including each frame step within a function execution.
Without this flag, the tracer would only trace function calls and nothing more.
We would not know which line is being executed within the function execution.

Differential Revision: https://phabricator.services.mozilla.com/D201977
2024-02-27 14:52:12 +00:00
Alexandre Poirot de907e9f52 Bug 1879087 - [devtools] Trace DOM mutations. r=devtools-reviewers,nchevobbe
Also allow logging trace whenever any DOM Element get added, removed or modified.
For now this is exposed only via the console command via:
  :tracer --dom-mutations  (for all types of mutation)
  :tracer --dom-mutations add,attributes,remove (coma separated list of mutation types you want to listen for)

Also revise the handling of "isWorker" so that all checks have the best possible check.

Differential Revision: https://phabricator.services.mozilla.com/D201976
2024-02-22 08:52:21 +00:00
Mark Banner b5df22ad0f Bug 1880535 - Enable ESLint rule no-unused-private-class-members. r=Gijs,webdriver-reviewers,webcompat-reviewers,extension-reviewers,application-update-reviewers,devtools-reviewers,translations-reviewers,bytesized,twisniewski,jhirsch,robwu,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D202002
2024-02-20 22:09:21 +00:00
Gijs Kruitbosch b33d5685da Bug 1780071 - Manual fixes/disabling of no-comparison-or-assignment-inside-ok for exceptional cases, r=Standard8,devtools-reviewers,anti-tracking-reviewers,places-reviewers,dom-storage-reviewers,pbz,asuth,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D198979
2024-02-19 23:30:40 +00:00
Greg Stoll b2839267e7 Bug 1871135 - Add content analysis support to clipboard operations r=edgar,nika,masayuki,devtools-reviewers
When content analysis is on, pastes will be checked by the CA
agent while tab input is blocked. The synchronous nsIClipboard.getData()
method must block until the analysis result is received, so this
requires doing a SpinEventLoopUntil.

Differential Revision: https://phabricator.services.mozilla.com/D196997
2024-02-13 11:26:48 +00:00
Alexandre Poirot d42ef20edd Bug 1852028 - [devtools] Log function return in javascript tracer. r=devtools-reviewers,nchevobbe
For now, we were only logging when we enter a function call, but not when we exit.

Differential Revision: https://phabricator.services.mozilla.com/D200173
2024-02-13 09:38:50 +00:00
Nicolas Chevobbe d884a53b36 Bug 1879086 - [devtools] Fix browser_webconsole_custom_formatters_errors.js failure on beta. r=devtools-reviewers,ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D201114
2024-02-09 06:28:52 +00:00
Alexandre Poirot 2f676c75ba Bug 1876297 - [devtools] Only force overiding local scope variables for frontend commands relying on console commands. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
We should probably expose new RDP methods to prevent relying on console evaluations for this.
We would still have some potential issues if the evaluated method is about a JS symbol
whose name is the console command.

Differential Revision: https://phabricator.services.mozilla.com/D200167
2024-02-02 12:41:00 +00:00