Commit Graph
208 Commits
Author SHA1 Message Date
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
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
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
Alexandre Poirot 6fc6849dbd Bug 1848159 - [devtools] Use tracing icon for all messages related to the tracing. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D199975
2024-01-30 20:18:51 +00:00
Alexandre Poirot 87632826c1 Bug 1873007 - [devtools] Show the reason why the JS tracer stopped. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D197660
2024-01-09 17:49:02 +00:00
Alexandre Poirot 17410e0a75 Bug 1870801 - [devtools] Log JS tracer start/stop, even when not initiated from console command. r=devtools-reviewers,nchevobbe
The JavaScript Tracer may be initiated by the debugger, or stoped by itself when reaching some limit.
In these cases, the start and stop messages wouldn't have been logged in the console.

Differential Revision: https://phabricator.services.mozilla.com/D196831
2024-01-09 17:49:01 +00:00
Natalia Csoregi 1275fd0f83 Backed out 3 changesets (bug 1873007, bug 1870801) for causing failures on browser_dbg-javascript-tracer.js. CLOSED TREE
Backed out changeset f94198e20472 (bug 1873007)
Backed out changeset c0f126c79de5 (bug 1870801)
Backed out changeset 885f112d1076 (bug 1870801)
2024-01-09 04:27:57 +02:00
Alexandre Poirot 798ab0197c Bug 1873007 - [devtools] Show the reason why the JS tracer stopped. r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D197660
2024-01-08 16:24:12 +00:00
Alexandre Poirot 3035bf5707 Bug 1870801 - [devtools] Log JS tracer start/stop, even when not initiated from console command. r=devtools-reviewers,nchevobbe
The JavaScript Tracer may be initiated by the debugger, or stoped by itself when reaching some limit.
In these cases, the start and stop messages wouldn't have been logged in the console.

Differential Revision: https://phabricator.services.mozilla.com/D196831
2024-01-08 16:24:11 +00:00
Alexandre Poirot 641c35b909 Bug 1835614 - [devtools] Use a custom resource for traces. r=devtools-reviewers,nchevobbe
This help reduce the RDP overhead by only transferring what is strictly necessary.
The console message resources bundles various useless attributes.

This also help use a custom rendering in the frontend so that traces can
be displayed distinctly and differently from the console API calls.

Differential Revision: https://phabricator.services.mozilla.com/D196020
2023-12-19 18:01:52 +00:00
Narcis Beleuzu 54a3764889 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 193fc9986e Bug 1835614 - [devtools] Use a custom resource for traces. r=devtools-reviewers,nchevobbe
This help reduce the RDP overhead by only transferring what is strictly necessary.
The console message resources bundles various useless attributes.

This also help use a custom rendering in the frontend so that traces can
be displayed distinctly and differently from the console API calls.

Differential Revision: https://phabricator.services.mozilla.com/D196020
2023-12-19 09:20:33 +00:00
Nicolas Chevobbe f5210de43f Bug 1267856 - [devtools] Don't clear output on console.clear() when persist logs is on. r=devtools-reviewers,bomsy.
When persist log is enabled and console.clear is called,
don't clear the output and display a message to indicate
the method was ignored

Differential Revision: https://phabricator.services.mozilla.com/D183854
2023-07-20 14:48:27 +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
Nicolas Chevobbe 43d6c660e0 Bug 1801462 - [devtools] Guard getWarningGroupType on message. r=jdescottes.
This should prevent to crash the browser until we find out
why this function is called with undefined.

Differential Revision: https://phabricator.services.mozilla.com/D166791
2023-01-13 16:29:27 +00:00
Tom Schuster 4ae19a4911 Bug 1525624 - Group CSP warning messages in the console. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D163828
2023-01-10 09:23:47 +00:00
Cosmin Sabou 05ce4a8787 Backed out changeset 7cacd26eab2e (bug 1525624) for devtools failures on browser_webconsole_navigate_to_parse_error.js. CLOSED TREE 2022-12-12 22:52:59 +02:00
Tom Schuster b7c68c2b8d Bug 1525624 - Group CSP warning messages in the console. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D163828
2022-12-12 16:01:06 +00:00
Alexandre Poirot 59fe57c052 Bug 1793396 - [devtools] Use absolute URLs in all usages of loader.lazyRequireGetter. r=Honza
Differential Revision: https://phabricator.services.mozilla.com/D158489
2022-10-03 18:57:13 +00:00
Alexandre Poirot 465fac9684 Bug 1792847 - [devtools] Use absolute URLs to import modules in devtools/client/webconsole. r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D158380
2022-09-30 15:17:40 +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
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
Alexandre Poirot e9d2d13e2b Bug 1619296 - [devtools] Make the TargetCommand populate its own redux store. r=nchevobbe
This allows to pull out target management code out from toolbox back to TargetCommand.
And then allows to more easily share this store in the context of the browser console,
where there is no toolbox.

This is also an interesting example on how commands may populate redux store directly
so that we avoid having each panel translate commands's event into actions.

An alternative here, would be to introduce some generic layer between commands and redux.
Which would be the glue between a command and populating a store.

Differential Revision: https://phabricator.services.mozilla.com/D151493
2022-07-18 14:54:43 +00:00
Nicolas Chevobbe 9839ef29e9 Bug 1744240 - [devtools] Set navigation message source to CONSOLE_FRONTEND. r=ochameau.
This fixes an intermittent on browser_webconsole_warn_about_replaced_api.js where
an assertion was failing because the navigation message had the `console-api` class.
We take this as an opportunity to add a navigation marker specific component instead
of reusing the ConsoleApiCall one.

Differential Revision: https://phabricator.services.mozilla.com/D149739
2022-06-20 14:03:18 +00:00
Nicolas Chevobbe 1c747c6f5f Bug 1773879 - [devtools] Fix Copy all Message context menu action in Browser Console. r=jdescottes.
We don't have a toolbox in the Browser Console, so we don't
need to have a Provider for its store.
A simple test is added, just checking that the action was
triggered.

Differential Revision: https://phabricator.services.mozilla.com/D149593
2022-06-20 05:21:36 +00:00
Tooru Fujisawa 33c166cd04 Bug 1766984 - Do not remove 3rd and remaining parameters when falling back to log from console.table. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D145138
2022-05-02 11:45:18 +00:00
Sebastian Zartner b7be1d93cb Bug 1746824 - Added JsonML Rep. r=nchevobbe,devtools-backward-compat-reviewers
This Rep hooks into the default display of objects and outputs a JsonML (http://www.jsonml.org) representation of them if custom formatters are enabled and a custom formatter is defined for them.
It handles headers and bodies of custom formatters. Bodies are handled asynchronously from their corresponding headers.

Because custom formatters allow a website to provide CSS styles to be used for formatting an object within the DevTools, those styles are filtered first to avoid breaking their layout.

It is currently only applied to the output of the Webconsole and within the variable value popup and the watch expressions within the Debugger.

***

Differential Revision: https://phabricator.services.mozilla.com/D140119
2022-04-28 18:50:30 +00:00
Nicolas Chevobbe b571060f67 Bug 1764236 - [devtools] Make copy messages action compatible with virtualized console. r=dthayer.
This is a naive implementation where we re-create a ConsoleOutput
element, reusing the existing store, and passing a specific prop
so all the messages would be rendered.

In order to include stacktraces, we pass a `0` initial render delay to the
callsites of the `SmartTrace` component.
We take this as an opportunity to extend the test coverage of `SmartTrace` around
this feature.

Differential Revision: https://phabricator.services.mozilla.com/D142189
2022-04-12 06:45:37 +00:00
Marian-Vasile Laza f67bf0cb70 Backed out changeset db337e401470 (bug 1764236) as requested by the dev. CLOSED TREE 2022-04-11 22:53:55 -07:00
Nicolas Chevobbe 44e655d26a Bug 1764236 - [devtools] Make copy messages action compatible with virtualized console. r=dthayer.
This is a naive implementation where we re-create a ConsoleOutput
element, reusing the existing store, and passing a specific prop
so all the messages would be rendered.

In order to include stacktraces, we pass a `0` initial render delay to the
callsites of the `SmartTrace` component.
We take this as an opportunity to extend the test coverage of `SmartTrace` around
this feature.

Differential Revision: https://phabricator.services.mozilla.com/D142189
2022-04-12 05:36:59 +00:00
Doug Thayer 36900d2f1f Bug 1753177 - Use a virtualized list for webconsole output r=nchevobbe
This should be ready to review. However, I will include a big caveat that I
tried to do things the Reacty way, and it felt really awkward. Notably, I used
a React functional component, because they seem to be recommended as the
Right Way to do things, but because of all the state we need to keep track of,
as well as just the props that we don't want to lexically access because then
they can be stale, it felt really wrong. Guidance is welcome.

However, the core logic should be ready for review, so focus on that, and let
me know if I need to move anything around to make it more palatable.

Depends on D138030

Differential Revision: https://phabricator.services.mozilla.com/D138031
2022-04-11 02:50:46 +00:00
Nicolas Chevobbe ec8626b082 Bug 1760590 - [devtools] Remove unhelpful console-message resource properties. r=ochameau.
- `category` isn't being used for console messages, so we can remove it
- `chromeContext` is only helpful when it's true, so we can omit it when it is not

We take this as an opportunity to test more properties and more message types
in browser_resources_console_messages.js.

Differential Revision: https://phabricator.services.mozilla.com/D141599
2022-04-01 13:03:56 +00:00
Nicolas Chevobbe 8f2db4a2ad Bug 1759414 - [devtools] Move Export Visible Messages context menu actions outside of their submenu. r=jdescottes.
We take this opportunity to rename the actions so they're
more consistent with the other entries.

Depends on D140804

Differential Revision: https://phabricator.services.mozilla.com/D140943
2022-03-15 06:26:39 +00:00
Nicolas Chevobbe d9673fd60b Bug 1758986 - [devtools] Remove Select All context menu entry. r=jdescottes.
This action provides little value since we have a "Export to clipboard" action
that goes a step further.
Removing it will also help with virtualization as it will be one less thing to
take care of.

Differential Revision: https://phabricator.services.mozilla.com/D140804
2022-03-14 06:52:08 -04:00
criss 1bd43bd43f Backed out changeset 0135c148f748 (bug 1758986) for causing bc failures. CLOSED TREE 2022-03-14 11:14:17 +02:00
Nicolas Chevobbe d91287f2c6 Bug 1758986 - [devtools] Remove Select All context menu entry. r=jdescottes.
This action provides little value since we have a "Export to clipboard" action
that goes a step further.
Removing it will also help with virtualization as it will be one less thing to
take care of.

Differential Revision: https://phabricator.services.mozilla.com/D140804
2022-03-14 06:10:44 +00:00
Nicolas Chevobbe b9cca0b2f5 Bug 1755662 - [devtools] Speedup ConsoleApiCall component. r=jdescottes.
The formatReps function was iterating twice on all the parameters,
first with a map call, and then a reduce call, in which we were
recreating a new array for each parameter.
We turn this into a simple for loop so we'll iterate only once.
We also simplify the getObjectInspector function so it doesn't
create new objects when there's no need to.

Differential Revision: https://phabricator.services.mozilla.com/D138885
2022-02-18 14:51:31 +00:00
Nicolas Chevobbe 98ba391d64 Bug 1754453 - [devtools] Early exit getWarningGroupType when message can't be in a warningGroup. r=dthayer.
If the message isn't a warning or an info, it can't
be in a warningGroup, so we can exit the function
earlier and avoid useless checks.

Differential Revision: https://phabricator.services.mozilla.com/D138299
2022-02-11 06:06:19 +00:00
Nicolas Chevobbe f475087a7a Bug 1643797 - [devtools] Improve Console message repeat performance. r=dthayer.
Differential Revision: https://phabricator.services.mozilla.com/D138013
2022-02-08 08:44:06 +00:00
Claudia 818735df8e Bug 1358383 - [devtools] Adds a command history list. r=bomsy
Differential Revision: https://phabricator.services.mozilla.com/D122264
2021-09-02 15:22:19 +00:00
Claudia f5657aec0f Bug 1430022 - [devtools] Adds an error message in the copy command on a cyclic object r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D120623
2021-07-29 05:36:13 +00:00
Alexandre Poirot f3b6620342 Bug 1701790 - Migrate ResourceWatcher to become ResourceCommand. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D113930
2021-05-04 09:29:47 +00:00
Brindusan Cristian d5be5fbb54 Backed out 5 changesets (bug 1701790) for bc failures in browser_ext_devtools_network_targetSwitch.js. CLOSED TREE
Backed out changeset 3fc4edd663d9 (bug 1701790)
Backed out changeset 2d3ea7c0d695 (bug 1701790)
Backed out changeset 6cb7502fc1a2 (bug 1701790)
Backed out changeset 8f4205a1a369 (bug 1701790)
Backed out changeset bd3c9b1482c7 (bug 1701790)
2021-05-03 22:21:59 +03:00
Alexandre Poirot 2887d898e4 Bug 1701790 - Stop using ResourceWatcher symbol for fetch resource types. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D113931
2021-05-03 18:07:30 +00:00
Nicolas Chevobbe f794b74d26 Bug 1705697 - [devtools] Warning group messages shouldn't be repeatable. r=bomsy.
It could happen that 2 warning group messages could be added successively, before
the navigation message was emitted.
In the reducer, the second message would be seen the same as the first one, and
we'd try to increment the repeat count for the first one.
Unfortunately, the code was expecting a warning group to be created, and there
was an exception thrown as we couldn't retrieve it.
This is fixed by not allowing warning groups to be repeated.
A mocha test is added instead of a mochitest, as the issue would have been tricky
to trigger properly.

Differential Revision: https://phabricator.services.mozilla.com/D113276
2021-04-28 08:10:13 +00:00
Nicolas Chevobbe 6e302822e5 Bug 1691934 - [devtools] Remove clearLogpointMessages and associated code. r=ochameau.
Differential Revision: https://phabricator.services.mozilla.com/D104679
2021-02-10 14:49:47 +00:00
Nicolas Chevobbe 87a0cc6ad7 Bug 1599317 - [devtools] Fix performance issue in ObjectInspector when we have a lot of instances. r=bomsy.
At the moment, the ObjectInspector, while having its own reducer and actions, has its
state located in the state of its consumer application (e.g. webconsole, debugger).
This patch, by adding a `standalone` prop to the ObjectInspector, will allow the said
consumer to not have the object inspector state shared anymore.
This makes interaction in a given objectInspector much faster as only one instance
will have its lifecycle methods triggered. It also prevent cloning the consumer's state
on each object inspector interaction.
This new props is only used in the webconsole for now, as the debugger might need
to have access to its objectInspector state (this is also less of a problem, because
the debugger won't hold that much instances at a given point in time, unlike the console).

The DAMP data seems to indicate a 40% improvement in the console when expanding
an object while there are a thousand instances in the console.

Differential Revision: https://phabricator.services.mozilla.com/D99472
2021-01-12 07:08:33 +00:00
Nicolas Chevobbe d42882193c Bug 1680440 - [devtools] Remove backward compatibility code in getNodeFrontFromNodeGrip. r=ladybenko,devtools-backward-compat-reviewers.
Since we now always have a contentDomReference in grips, we
don't need to fallback on gripToNodeFront.
And since gripToNodeFront was only used from getNodeFrontFromNodeGrip,
we can remove it, as well as the walker actor method getNodeActorFromObjectActor.

We also had to get a content reference from a rendered Reps in the console, for
the "Reveal in inspector" context menu entry, so we stringigy it in a data attribute.

Differential Revision: https://phabricator.services.mozilla.com/D98720
2020-12-11 13:53:14 +00:00
Hubert Boma Manilla 8538bba891 Bug 1662736 - [devtools] Simplify the network request payload r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D94457
2020-11-13 15:17:48 +00:00