Commit graph

803 commits

Author SHA1 Message Date
Norisz Fay
8851ada603 Backed out 2 changesets (bug 1887872) for causing dt failures on browser_dbg-old-breakpoint.js CLOSED TREE
Backed out changeset b32b818f2175 (bug 1887872)
Backed out changeset 705494857aed (bug 1887872)
2024-03-27 21:22:10 +02:00
Alexandre Poirot
3a3429eb93 Bug 1887872 - [devtools] Set breakpoints on toolbox opening. r=devtools-reviewers,devtools-backward-compat-reviewers,bomsy
Register them as soon as we open devtools, instead of waiting for debugger panel opening.
So that breakpoints can work even if we did not open debugger panel yet.
So far, only debugger statement would force the opening of the debugger.

This allows to remove the redundant code from debugger frontend.

Also clarify in this patch that thread-utils exports thread configurations.

Differential Revision: https://phabricator.services.mozilla.com/D205772
2024-03-27 17:04:34 +00:00
Nicolas Chevobbe
528d050e19 Bug 1881443 - [devtools] Lookup node from idref attribute within node rootNode. r=devtools-reviewers,devtools-backward-compat-reviewers,ochameau,bomsy.
In order to select elements referenced in idref/idreflist attributes,
we were querying the whole node document.
This is incorrect as id reference are scipes within a shadow root.
To fix this, we add a dedicated walker method to retrieve the referenced
node within the base node rootNode.
A test case is added to ensure we don't regress.

Differential Revision: https://phabricator.services.mozilla.com/D202451
2024-02-27 13:54:00 +00:00
Alexandre Poirot
384ad50604 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
Alexandre Poirot
cf6d19f16a Bug 1848159 - [devtools] Introduce an option to start tracing on next page load. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Because the JavaScript tracer is currently running in each process/thread/target actor independently,
it is more complex to make it record across navigations as it may be spawn in a distinct process.

While it is fine for stdout and webconsole outputs (we could just spawn many concurrent tracers in each process),
this is more complex for the experimental "profiler" output.
For now, the profiler output automatically stops on target destruction and will open the profiler result.

By having an option to start recording on next page load, it prevents starting the tracer and prevent logging traces
for the current WindowGlobal. It should help focus on the new document.
For the profiler output, it prevents having the profiler to show up for the previous WindowGlobal.

Sideby tweak:
* stop passing logMethod and consider, like other option to be coming from the preferences.
* fix confusing state when debugging a page running in the same process.

Differential Revision: https://phabricator.services.mozilla.com/D196874
2024-01-30 20:18:51 +00:00
Alexandre Poirot
6b018ef63f Bug 1875045 - [devtools] Release Object actors by bulk. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
For now we were releasing object actors one by one.
This would force to send an individual RDP request for each of them.
The console often release all objects actors related to older console message
going over the maximum limit of displayed console messages (10k).
This can easily grow in a large number of actors to be released,
either if console message are receiving many arguments and/or
if many console are logged.

We have to have one request per target as the actors could only be reached
within same-thread actor.
In order to prepare for ObjectFront removal, introduce a target-scoped "Objects" actor
which is a singleton per Target. It will receive the new "release in bulk objects actors"
method. Later, it will start implementing all the existing methods of the Object Actor
in order to migrate away from having to instantiate one Object Front (notice the singular on "Object"),
per inspected JS Object.

On the fronted side a new Object Command is introduced in order to abstract away the RDP/Fronts work.

Differential Revision: https://phabricator.services.mozilla.com/D198784
2024-01-29 13:59:51 +00:00
Iulian Moraru
50cafc734d Backed out 2 changesets (bug 1875045) for causing dt failures on browser_webconsole_console_logging_workers_api.js. CLOSED TREE
Backed out changeset 533ecc686bac (bug 1875045)
Backed out changeset f4ac089ead5a (bug 1875045)
2024-01-26 16:09:31 +02:00
Alexandre Poirot
ca7f8ba750 Bug 1875045 - [devtools] Release Object actors by bulk. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
For now we were releasing object actors one by one.
This would force to send an individual RDP request for each of them.
The console often release all objects actors related to older console message
going over the maximum limit of displayed console messages (10k).
This can easily grow in a large number of actors to be released,
either if console message are receiving many arguments and/or
if many console are logged.

We have to have one request per target as the actors could only be reached
within same-thread actor.
In order to prepare for ObjectFront removal, introduce a target-scoped "Objects" actor
which is a singleton per Target. It will receive the new "release in bulk objects actors"
method. Later, it will start implementing all the existing methods of the Object Actor
in order to migrate away from having to instantiate one Object Front (notice the singular on "Object"),
per inspected JS Object.

On the fronted side a new Object Command is introduced in order to abstract away the RDP/Fronts work.

Differential Revision: https://phabricator.services.mozilla.com/D198784
2024-01-26 10:41:43 +00:00
Alexandre Poirot
f69feec059 Bug 1835614 - [devtools] Log function call arguments. r=devtools-reviewers,fluent-reviewers,devtools-backward-compat-reviewers,nchevobbe
Introduce a new global option in the tracer to log values.

For now, it only triggers javascript function call arguments to be logged,
but this will also impact the incoming feature logging native function calls,
and also the other incoming feature to log the returned values.

Differential Revision: https://phabricator.services.mozilla.com/D196019
2023-12-19 18:01:52 +00:00
Narcis Beleuzu
3387523fc0 Backed out 2 changesets (bug 1835614) for xpcshell failure on test_tracer.js . CLOSED TREE
Backed out changeset 4501d1fb176a (bug 1835614)
Backed out changeset 60b933696a41 (bug 1835614)
2023-12-19 12:54:32 +02:00
Alexandre Poirot
f2f1573ae0 Bug 1835614 - [devtools] Log function call arguments. r=devtools-reviewers,fluent-reviewers,devtools-backward-compat-reviewers,nchevobbe
Introduce a new global option in the tracer to log values.

For now, it only triggers javascript function call arguments to be logged,
but this will also impact the incoming feature logging native function calls,
and also the other incoming feature to log the returned values.

Differential Revision: https://phabricator.services.mozilla.com/D196019
2023-12-19 09:20:34 +00:00
dylan
12c105f231 Bug 1156659 - Added offline network throttling to devtools. r=devtools-reviewers,bomsy,devtools-backward-compat-reviewers
Depends on D187704

Differential Revision: https://phabricator.services.mozilla.com/D187705
2023-10-04 19:42:57 +00:00
Norisz Fay
338171a737 Backed out 2 changesets (bug 1156659) for causing dt failures on browser_net_throttle.js CLOSED TREE
Backed out changeset af64e5a0109a (bug 1156659)
Backed out changeset 7e9b86bce76b (bug 1156659)
2023-10-02 16:11:21 +03:00
dylan
a97e16eb2e Bug 1156659 - Added offline network throttling to devtools. r=devtools-reviewers,bomsy,devtools-backward-compat-reviewers
Depends on D187704

Differential Revision: https://phabricator.services.mozilla.com/D187705
2023-10-02 04:13:43 +00:00
Sandor Molnar
e22024e42c Backed out 2 changesets (bug 1156659) for causing multiple dt failures on browser_jsterm_evaluation_context_selector_targets_update/browser_jsterm_file_load_save_keyboard_shortcut/browser_jsterm_focus_reload/etc CLOSED TREE
Backed out changeset 72676017aaf3 (bug 1156659)
Backed out changeset c5e205051938 (bug 1156659)
2023-09-26 19:54:00 +03:00
dylan
0c9eb8b05d Bug 1156659 - Added offline network throttling to devtools. r=devtools-reviewers,bomsy,devtools-backward-compat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D187705
2023-09-26 15:33:34 +00:00
Henrik Skupin
21ccf582af Bug 1852526 - [devtools] Remove "domstyleruleOrActorid" type. r=devtools-backward-compat-reviewers,devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D187894
2023-09-12 08:45:44 +00:00
Nicolas Chevobbe
723ec06e07 Bug 1845730 - [devtools] Don't return rules from PageStyleActor#getApplied. r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes.
The property isn't used anywhere, but those objects would still be serialized
(via `form()`) and sent to the client.
Specs are updated to reflect the new situation, and handle backward compatibility.

Differential Revision: https://phabricator.services.mozilla.com/D184728
2023-08-10 14:54:19 +00:00
Alexandre Poirot
4a165cef2b Bug 1835629 - [devtools] Prevent pausing and showing source of any internal devtools evaluation. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
This aligns all features in DevTools frontend currently evaluating some JavaScript code:
console input, eager evaluation, watch expression, log breakpoint, conditional breakpoint, inline preview, preview tooltips,
console "store as global", inspector "store as temp variable", DOM panel "window" retrieval,...

Except the console evaluation input, none of the many features evaluating code should:
* trigger any type of breakpoint via the evaluated code,
* evaluated sources should not be shown in the debugger.

This has been done by adding a `disableBreaks` argument to the web console actor evaluation method.
This mimic CDP's existing argument and disable trigerring any type of breakpoint,
while also avoiding instantiating Debugger.Source for the evaluated source.

Differential Revision: https://phabricator.services.mozilla.com/D180094
2023-06-29 19:41:46 +00:00
Nicolas Chevobbe
886ee2fb1e Bug 1789193 - [devtools] Display container badges in markup view. r=jdescottes,devtools-backward-compat-reviewers,devtools-reviewers.
This is a simple version for now, showing a non-interactive `container` badge
for elements with `container-type` of `size` or `inline-size` (`style` isn't
supported yet).

Differential Revision: https://phabricator.services.mozilla.com/D156567
2023-06-15 08:21:40 +00:00
Nicolas Chevobbe
8ae484b5e7 Bug 1834946 - [devtools] MDN compat data url is nullable. r=jdescottes,devtools-backward-compat-reviewers,devtools-reviewers.
The `mdn_url` property in the compatibility data is not always defined,
as some properties are not documented on MDN.
Luckily, there's a `spec_url` property that we can default to in such case,
so we return that from the server, and fall back to this in the compatibility
panel and the compatibility tooltip.

We might still have cases where we don't have any link at all, so in such case,
we don't render a link in the compatibility panel, and we don't show the "Learn more"
link in the compatibility tooltip.

In order to properly check the page the user might be taken to, we move
the `simulateLinkClick` helper to `shared-head.js` and use it in both compatibility
panel and compatibility tooltip assertion helpers.

Some tests are then updated to provide the now missing information that those
helpers expect.

Differential Revision: https://phabricator.services.mozilla.com/D179030
2023-05-26 09:37:49 +00:00
Iulian Moraru
f87fbc0b9d Backed out 2 changesets (bug 1659498, bug 1834946) for causing compatibility related failures. CLOSED TREE
Backed out changeset 655787761ee9 (bug 1659498)
Backed out changeset 00bc160667b0 (bug 1834946)
2023-05-26 11:55:20 +03:00
Nicolas Chevobbe
ec547beb1e Bug 1834946 - [devtools] MDN compat data url is nullable. r=jdescottes,devtools-backward-compat-reviewers,devtools-reviewers.
The `mdn_url` property in the compatibility data is not always defined,
as some properties are not documented on MDN.
Luckily, there's a `spec_url` property that we can default to in such case,
so we return that from the server, and fall back to this in the compatibility
panel and the compatibility tooltip.

We might still have cases where we don't have any link at all, so in such case,
we don't render a link in the compatibility panel, and we don't show the "Learn more"
link in the compatibility tooltip.

In order to properly check the page the user might be taken to, we move
the `simulateLinkClick` helper to `shared-head.js` and use it in both compatibility
panel and compatibility tooltip assertion helpers.

Some tests are then updated to provide the now missing information that those
helpers expect.

Differential Revision: https://phabricator.services.mozilla.com/D179030
2023-05-26 06:52:29 +00:00
Nicolas Chevobbe
ec366e92e8 Bug 1833617 - [devtools] Batch calls to retrieve rules compatibility issues. r=jdescottes,devtools-backward-compat-reviewers,devtools-reviewers.
Previously, we were calling `getCssDeclarationBlockIssues` for each dom rule.
This was causing performance issue when displaying a lot of rules as we'd make
almost concurrent RDP calls.

In this patch, we make `CompatibilityActor#getCssDeclarationBlockIssues` take
an array of dom rule declarations, so we can get the data for multiple rules at once.

From the client, we add a method to the inspector command, that will batch calls
to the RDP method.

`compatibility-user-settings.js` is moved to `devtools/shared` so it can safely
be loaded from the command.

Differential Revision: https://phabricator.services.mozilla.com/D178313
2023-05-25 07:44:21 +00:00
Emilio Cobos Álvarez
3dadb13b7a Bug 1825825 - Remove unused whatToShow option from devtools inspector walker. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
It's always SHOW_ALL, and it doesn't work anyways, see the treewalker impl.

Differential Revision: https://phabricator.services.mozilla.com/D174490
2023-04-04 08:56:37 +00:00
William Durand
475d4dd995 Bug 1823457 - Expose uninstallAddon method on addons actor. r=jdescottes,devtools-backward-compat-reviewers,devtools-reviewers
Depends on D173053

Differential Revision: https://phabricator.services.mozilla.com/D173126
2023-03-23 11:43:13 +00:00
Nicolas Chevobbe
d3637730d2 Bug 1823616 - [devtools] release tasks cycle 113 - Remove backward compatibility code. r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D173121
2023-03-22 14:50:22 +00:00
Alexandre Poirot
5cb1635d84 Bug 1803616 - [devtools] Implement a Javascript Tracer in the debugger. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
On the server side, this patch introduces:
* a new "tracer" Target Scope actor to start and stop tracing per target
* a new TRACING_STATE resource in order to report to the client when we start/stop tracing and with which log method.

On the frontend side, this patch introduces:
* a global tracer button, which will enable/disable tracing for all targets/threads
  all at once.
* a global header, similar to pause, reporting if any target is tracing or not.
The header reuses the pause header and we may want to followup to better coordinate case
where we pause and trace at the same time. Only one of the two states is displayed.

We may want to followup here to be able to trace only one target and see the state per target.

Differential Revision: https://phabricator.services.mozilla.com/D163614
2023-03-14 17:17:05 +00:00
Hubert Boma Manilla
92c40b4c19 Bug 1820737 - [devtools] Remove backward compatibility for lastPrivateContextExited r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D171844
2023-03-07 15:14:53 +00:00
Hubert Boma Manilla
448187bbe9 Bug 1820737 - [devtools] Remove backward compatibility code related to isBrowserToolboxFission r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D171843
2023-03-07 15:14:53 +00:00
Nicolas Chevobbe
ff63c3a66f Bug 1818687 - [devtools] Remove getBreakpointPositions from SourceActor spec. r=devtools-backward-compat-reviewers,devtools-reviewers,bomsy.
Differential Revision: https://phabricator.services.mozilla.com/D170850
2023-02-28 11:08:51 +00:00
Alexandre Poirot
050a0d45e2 Bug 1704690 - [devtools] Allow overriding request content with a local file. r=valentin,devtools-backward-compat-reviewers,bomsy,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D163600
2023-02-24 12:11:28 +00:00
Dennis Jackson
dd19a9405c Bug 1804460 - Add detailed connection info to WebRequest GetSecurityInfo API. r=keeler,devtools-backward-compat-reviewers,willdurand
Differential Revision: https://phabricator.services.mozilla.com/D164092
2023-02-14 17:24:46 +00:00
Alexandre Poirot
2dc32e362a Bug 1814013 - [devtools] Remove test-only echo request from the root actor. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
This wasn't so trivial to revisit tests, but at least we stop shipping test-only
features in RDP. And the cryptic echo implement now only exists in tests.

Differential Revision: https://phabricator.services.mozilla.com/D168360
2023-02-07 10:36:59 +00:00
Julian Descottes
040a85de53 Bug 1811138 - [devtools] Move ensureCSSErrorReportingEnabled to the CSS_MESSAGE watcher r=ochameau,perftest-reviewers,sparky,devtools-backward-compat-reviewers
We can also remove the legacy listener, as it is only ever triggered by worker toolboxes.

Differential Revision: https://phabricator.services.mozilla.com/D167211
2023-02-06 09:47:17 +00:00
Nicolas Chevobbe
f4083e1073 Bug 1812521 - [devtools] Don't rely on custom formatter index for body hook. r=ochameau.
Instead of keeping track of an index, store the formatter entry in
the object actor from `customFormatterHeader` so we can re-use it
in `customFormatterBody`.

Differential Revision: https://phabricator.services.mozilla.com/D167905
2023-02-03 14:02:46 +00:00
Julian Descottes
d3e8d2c2fc Bug 1814086 - [devtools] Enable ServerSentEvent resource for all sessions r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Depends on D168437

Differential Revision: https://phabricator.services.mozilla.com/D168438
2023-02-02 20:53:56 +00:00
Julian Descottes
7d03bd6ee6 Bug 1814086 - [devtools] Enable WebSocket resource for all sessions r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Depends on D168436

Differential Revision: https://phabricator.services.mozilla.com/D168437
2023-02-02 20:53:55 +00:00
Alexandre Poirot
1efc237714 Bug 1810095 - [devtools] Remove now-unused Storage target scoped actor. r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes
This actor was only used by the legacy listener.
Its main method was listStores which exposed all the storage type actors.
Now they are exposed via storage Resource watchers.

This requires to tweak the decision making to show the storage panel
as the actor no longer exists... Unfortunately we can't check for
resource traits on the watcher actor as the browser toolbox
on older runtime won't expose it.

Note that this.front wasn't used for a little while in ui.js.

I had to keep a few things in the frontend in order to still be able
to connect to old servers. But I put lots of comments to do proper cleanup later.

Differential Revision: https://phabricator.services.mozilla.com/D166770
2023-01-29 20:50:48 +00:00
Alexandre Poirot
94e02496ef Bug 1666534 - [devtools] Listen to extension storages via a server side watcher. r=devtools-reviewers,nchevobbe,jdescottes
This was the last resource type requiring to keep the old storage actor as-is.
This will help drastically simplify it and move storage type code into each Resource Watcher class.

Differential Revision: https://phabricator.services.mozilla.com/D166661
2023-01-29 20:50:47 +00:00
Julian Descottes
e6751f2636 Bug 1808870 - [devtools] Remove the stylesheet actor r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Depends on D166144

Differential Revision: https://phabricator.services.mozilla.com/D166146
2023-01-17 08:06:15 +00:00
Julian Descottes
45015576d9 Bug 1808870 - [devtools] Remove unused code branches behind hasStyleSheetWatcherSupport r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Depends on D166142

Differential Revision: https://phabricator.services.mozilla.com/D166143
2023-01-17 08:06:14 +00:00
Julian Descottes
32445baa46 Bug 1808870 - [devtools] Remove mediarule actor r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Depends on D166141
Quick followup, we can fully remove the actor.

Differential Revision: https://phabricator.services.mozilla.com/D166142
2023-01-17 08:06:14 +00:00
Julian Descottes
528a29e9eb Bug 1808870 - [devtools] Remove unused media-rules-changed event and getMediaRules r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
Depends on D166139

This is one of the easiest actors to unplug, and it has very little connections to the rest, so doing it early in the stack

Differential Revision: https://phabricator.services.mozilla.com/D166141
2023-01-17 08:06:13 +00:00
Alexandre Poirot
ee7ed1e669 Bug 1808309 - [devtools] Remove web console actor's sendHttpRequest method. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
This is no longer used by the DevTools frontend.
NetworkContent.sendHTTPRequest should be used instead.

Differential Revision: https://phabricator.services.mozilla.com/D165865
2023-01-04 18:27:22 +00:00
Alexandre Poirot
4597b94bcd Bug 1808308 - [devtools] Remove unused getPreferences and setPreferences of the console actor. r=devtools-reviewers,devtools-backward-compat-reviewers,nchevobbe
These preferences ended up being specifics to network observation.
The only one lastly supported is now set via NetworkParentActor.setSaveRequestAndResponseBodies.

Differential Revision: https://phabricator.services.mozilla.com/D165864
2023-01-04 18:27:22 +00:00
Alexandre Poirot
6340009cb3 Bug 1721592 - [devtools] Remove old server codebase to listen to network events. r=devtools-reviewers,devtools-backward-compat-reviewers,jdescottes
With the removal of the old non-fission browser toolbox,
we removed the last usage of this old codebase.
We used to be able to listen to network events via WebConsole's actor's startListeners method.
Nowadays we should rather use the Watcher actor's watchResources method and listen to
NETWORK_EVENT resource.
(or migrate to WebDriver Bidi which will soon allow to listen to network requests see bug 1790369)

This patch also removed all now unused block* requests from webconsole actor,

Differential Revision: https://phabricator.services.mozilla.com/D165603
2023-01-04 18:27:21 +00:00
Julian Descottes
9bb5510fe5 Bug 1808300 - [devtools] Fix backward compatibility issue when using multiprocess browser toolbox from about:debugging r=devtools-reviewers,ochameau
Older servers still need the boolean isBrowserToolboxFission for getWatcher/getTarget.

Differential Revision: https://phabricator.services.mozilla.com/D165950
2023-01-04 14:34:35 +00:00
Alexandre Poirot
7248bcde36 Bug 1625939 - [devtools] Remove reference to isBrowserToolboxFission and remove the related logic from server codebase. r=nchevobbe,devtools-backward-compat-reviewers
This changeset focuses on the server codebase and a few bits from the frontend.

Differential Revision: https://phabricator.services.mozilla.com/D164702
2022-12-20 10:16:49 +00:00
Nicolas Chevobbe
00840021c6 Bug 1796095 - [devtools] Display query container data in a tooltip in the rule view. r=jdescottes,devtools-backward-compat-reviewers.
This patch adds a tooltip that is displayed when the user hovers a `@container`
declaration in the rule view.
The tooltip displays the query container that is used for this rule and the selected
node and the computed values of its `containerType`, `inlineSize` and `blockSize`
(if the `containerType` is `size`) properties.

The title attribute is removed on the `ruleview-rule-ancestor-data` items as it
was not playing well with the new tooltip. The styling for those element is
modified so they are never cropped so we can see the whole text (and don't need
the title anymore).

A test case is added to make sure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D161129
2022-11-08 12:46:27 +00:00