Commit Graph
104 Commits
Author SHA1 Message Date
Nicolas Chevobbe d38e3fae98 Bug 1579090 - Support ObjectFronts in WebConsole. r=Honza.
Since we may now have ObjectFronts in console messages as
well as in evaluation results, we need to make the webconsole
consume those fronts.

And because we have ObjectFronts, we can now avoid using the
DebuggerClient to release the actors, and simply call front.release.
This simplifies how we track created object, since we only need
to release "root" objects, which will also cause all the sub-fronts
to be released as well. Sadly, this was causing some test failures
in mochitests because some objects were released while the connection
was closed, so we now emit an event when all the actors are released,
which we track in tests to wait until everything is over.

As a side effect, we need to change how we handle stubs for
our tests, since fronts have cycical references and can't
be serialized directly. In order to handle that, we serialize
all front as a plain object with a `_grip` property, containing
the object grip. In the stub file, we don't expose the grips
directly, but Maps that contain those stubs "rehydrated": when
a _grip object is encountered, it's turned back into a front.

Differential Revision: https://phabricator.services.mozilla.com/D54509
2019-12-04 09:03:53 +00:00
Nicolas Chevobbe 059bde8b04 Bug 1579090 - Change how ObjectFront is exported. r=rcaliman.
We export it as a named property to match other fronts, and
also because we plan to add a helper function in the file
that will need to be exported as well.

Differential Revision: https://phabricator.services.mozilla.com/D54136
2019-12-04 09:01:57 +00:00
Nicolas Chevobbe a1418a412a Bug 1536523 - Support performance.getEntries result in console.table. r=Honza.
PerformanceEntry values are put in the `getterValue` property in
the descriptor, so whenever we want to display a table we need
to check if the value could be in there.
This highlighted an issue in the console layout when there is a
large number of cells, which we fix in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D54261
2019-11-26 09:56:40 +00:00
Raymond Liu 73983a5467 Bug 1214556 - Add open url MenuItem for links in Web Console. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D54418
2019-11-26 09:04:29 +00:00
Nicolas Chevobbe 1175e2f5b3 Bug 1326182 - Send all the console.table items in the console message. r=Honza.
This allows us to not have to reach for the server
again from the client to get all the data we need
to render the table.

We still need to keep the old function to handle
connections to older servers. We'll use Bug 1597955
in Firefox 74 to clean the bits we don't need anymore.

A test is added to ensure the bug is fixed and we don't
regress; stubs are updated.

Differential Revision: https://phabricator.services.mozilla.com/D53962
2019-11-22 09:48:58 +00:00
Nicolas Chevobbe 1094485c43 Bug 1597295 - Allow to pass a pathPrefix property to the WebConsole ObjectInspector util. r=jlast.
This will allow us to not have 2 object inspectors
with the same name, which was causing an issue
when putting an object in the sidebar (the object
in the sidebar and the one in the output would share
the same key in the objectInspector key, meaning that
expanding/collapsing nodes on one of them would also
do it on the other one).
A test needed to be modified where we were relying on
this behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D53666
2019-11-20 18:05:42 +00:00
Nicolas Chevobbe 30153880c1 Bug 1595594 - Add support for typed arrays to console.table. r=Honza.
In order to render a table, we first check that console.table is
called with data that can be displayed in a table. Until now, we
were missing all the typed arrays.
This revealed some smaller issues:
- BigInt64Array were not marked as typed arrays on the server.
- Generating the repeatId for a message containing BigInts would
  throw because BigInts can't be serialized.

We add test cases for all the typed array, and we take this opportunity
to add a test case to ensure object insides table cells can be expanded.

Differential Revision: https://phabricator.services.mozilla.com/D53155
2019-11-19 13:37:07 +00:00
Jason Laster 4aa8ec8164 Bug 1594979 - Logpoints fail to log with frame is null. r=bhackett
Differential Revision: https://phabricator.services.mozilla.com/D52310
2019-11-08 16:49:11 +00:00
Julian Descottes 03cdcd7b0a Bug 1593921 - Use eslint-disable-next-line to disable complexity checks in DevTools r=pbro
Using next-line is less error prone for refactorings than wrapping methods with enable/disable blocks.

Differential Revision: https://phabricator.services.mozilla.com/D51782
2019-11-05 14:29:04 +00:00
Mihai Alexandru Michis c385be38b5 Backed out changeset ca55fba5a3a3 (bug 1592144) for causing node devtools failures. CLOSED TREE 2019-10-29 16:19:31 +02:00
David Walsh 9b735b8912 Bug 1592144 - Only set frame logpoint if frame exists r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D50875
2019-10-29 07:48:23 +00:00
Nicolas Chevobbe ce25c3f455 Bug 1519103 - Remove Scratchpad panel. r=bgrins.
Differential Revision: https://phabricator.services.mozilla.com/D50583
2019-10-27 09:05:58 +00:00
wartmanm eb01792710 Bug 1433373 - Use source mapping for console jump to definition button r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D38096
2019-10-07 08:40:04 +00:00
Jason Laster 3934a4c8a5 Bug 1582870 - Reduxify console actions. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D46674
2019-10-02 22:50:25 +00:00
Nicolas Chevobbe 31bb7f3d0a Bug 1584973 - Always lazy load Reps bundle. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D47729
2019-10-02 08:05:57 +00:00
Oana Pop Rus ce530ebdd0 Backed out 2 changesets (bug 1584973) for devtools node failure on a CLOSED TREE
Backed out changeset c06273b25769 (bug 1584973)
Backed out changeset e63ea229519d (bug 1584973)
2019-10-02 02:30:42 +03:00
Nicolas Chevobbe 70ece40caf Bug 1584973 - Always lazy load Reps bundle. r=Honza.
Depends on D47728

Differential Revision: https://phabricator.services.mozilla.com/D47729
2019-10-01 09:36:51 +00:00
Emilio Cobos Álvarez 305ccf1f45 Bug 1581472 - Only treat CSS parser errors as CSS errors. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D45986
2019-09-16 10:12:47 +00:00
Jason Laster ab8a1ed059 Bug 1580064 - Replace ObjectInspector symbol with better delimeter. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D45286
2019-09-10 22:47:42 +00:00
Nicolas Chevobbe 908127976b Bug 1578389 - Fix propTypes error in console. r=Honza.
Fix 2 proptype errors: one in App.js, and the
other one in the renderStacktrace function,
that is called by Error rep.

Differential Revision: https://phabricator.services.mozilla.com/D44467
2019-09-03 13:55:45 +00:00
Gabriel Luong 20052248e9 Bug 1568157 - Part 3: Replace toolbox.highlighter with the contextual HighlighterFront. r=yulia
Differential Revision: https://phabricator.services.mozilla.com/D40316
2019-08-27 19:13:45 +00:00
Nicolas Chevobbe c377b24000 Bug 1576085 - Don't allow evaluation results to be repeated. r=Honza.
With top-level await, we can now have multiple
evaluation results next to each others. Which
means that if they had the same repeatId, we
would only print the first result.
We fix that by not allowing evaluation results to
be repeated.
A mochitest is added to ensure the patch properly
fixes the issue.

Differential Revision: https://phabricator.services.mozilla.com/D43253
2019-08-26 11:18:50 +00:00
Nicolas Chevobbe 290ba5cb21 Bug 1568779 - Remove editors settings comments in devtools files. r=pbro.
Differential Revision: https://phabricator.services.mozilla.com/D42300
2019-08-19 12:48:16 +00:00
Gijs Kruitbosch 3614343935 Bug 1571342 - unify save paths for console and netmonitor and fix the latter to not do docshell loads, r=Honza,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D41858
2019-08-16 11:13:24 +00:00
chujun c6fa068ff8 Bug 1557138 Clicking logpoint location in console opens the logpoint editing panel in debugger r=nchevobbe,jlast
I pass `frame.origin` in `viewSourceInDebugger`. When `reason` is logpoint, run `openConditionalPanel`.

Differential Revision: https://phabricator.services.mozilla.com/D35624
2019-08-14 16:10:50 +00:00
Nicolas Chevobbe b71ffcdf97 Bug 1441711 - Create multiple proxies when in Fission Browser Console. r=ochameau.
When opening the Browser Console, if the browser toolbox fission pref
is enabled, we create a WebConsoleConnectionProxy for each process.
This allow us to not start the ContentProcessMessages listener (that
uses ContentProcessMessagesForward), but directly connect to the content
process, to get fully inspectable console message, from the Browser Console.

We keep the this.proxy reference in WebConsoleUI to represent the "main" target
proxy, and we add an `additionalProxies` property that represent proxies
for other targets we connect to (e.g. content process targets).
We then have a function to list all the proxies we're handling, in order to
be able to do tasks on all of them (e.g. clearing cache, network message, ...)

We also take this as an opportunity to add a `evaluateJSAsync` at the
WebConsoleUI level so callsites don't retrieve the proxy.webConsoleClient
themselves.

Differential Revision: https://phabricator.services.mozilla.com/D40786
2019-08-08 13:23:03 +00:00
Nicolas Chevobbe 25a1093676 Bug 1567174 - Move expression evaluation to a proper Redux action. r=jdescottes.
The goal is to not directly use the panel.hud.ui.proxy reference
directly from the JsTerm, so we're in better shape when Fission
comes.
It's also a nice refactor to make the JSTerm component more
React-like.
As a nice benefit, we can handle telemetry and history persistence
from their middleware.
As the `requestEvaluation` method is removed from the JSTerm, some
callsites needed to be updated to still work.

Differential Revision: https://phabricator.services.mozilla.com/D39022
2019-08-02 11:49:21 +00:00
Ciure Andrei 74372a9da1 Backed out 2 changesets (bug 1568143, bug 1567174) for causing browser_ext_addon_debugging_netmonitor.js to perma fail CLOSED TREE
Backed out changeset a8faaa1c722e (bug 1568143)
Backed out changeset 5dddaeb1e952 (bug 1567174)
2019-08-02 00:50:34 +03:00
Nicolas Chevobbe c2ebae7e8a Bug 1567174 - Move expression evaluation to a proper Redux action. r=jdescottes.
The goal is to not directly use the panel.hud.ui.proxy reference
directly from the JsTerm, so we're in better shape when Fission
comes.
It's also a nice refactor to make the JSTerm component more
React-like.
As a nice benefit, we can handle telemetry and history persistence
from their middleware.
As the `requestEvaluation` method is removed from the JSTerm, some
callsites needed to be updated to still work.

Differential Revision: https://phabricator.services.mozilla.com/D39022
2019-08-01 06:47:41 +00:00
Nicolas Chevobbe d34a531e46 Bug 1568439 - Move webconsole-l10n to utils/l10n. r=jdescottes.
Differential Revision: https://phabricator.services.mozilla.com/D39159
2019-07-24 11:11:34 +00:00
Nicolas Chevobbe 319b6d8fbf Bug 1567167 - Remove copyObject function from JSTerm. r=jdescottes.
The function is only called from the context-menu,
where we already have all the references we need.
So we can move the function code directly in the
menu item callback.

Differential Revision: https://phabricator.services.mozilla.com/D38613
2019-07-19 08:28:24 +00:00
Nicolas Chevobbe db0b64398f Bug 1554877 - Make JsTerm editor resizable. r=Honza.
We add a GridElementWidthResizer to handle the editor width.
The width is then persisted in a pref.
A test is added to ensure this works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D37687
2019-07-18 05:51:44 +00:00
yulia 7eba825d59 Bug 1559819 - rename threadClient to threadFront; r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D32848
2019-07-11 09:45:32 +00:00
Victor Porof b7732ae890 Bug 1561435 - Format devtools/client/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35884
2019-07-05 11:24:38 +02:00
Jefry Lagrange ead0aa8e6c Bug 1517728 - Export Console content to file. .
Add a context menu entry to export the console output to a file.
We group the 2 export entries into a submenu.

Differential Revision: https://phabricator.services.mozilla.com/D22158
2019-06-28 08:28:53 +00:00
chujun 0f000fd48b Bug 1536854 - Log errors from logpoint as actual errors in the console r=davidwalsh,nchevobbe
If logpoint throws, set `level` to "error".
Add tests to ensure the correct level is set.

Demo function: https://luxuriant-system.glitch.me/
Add some logpoints. The first two statements are invalid. The third one is valid.
{F1311386}

In console:
{F1311387}

Differential Revision: https://phabricator.services.mozilla.com/D31157
2019-06-12 12:10:35 +00:00
Nicolas Chevobbe e90cdb4b69 Bug 1545888 - Use template-styled message with placeholders as warning group labels. r=Honza.
This allows to have more meaningful warning group messages, i.e.
"Content Blocking" is turned into something like "The resource at
'<URL>' was blocked because content blocking is enabled".

This is done by parsing the message of the first warning to put
in the group, and replacing the URL with a generic placeholder.

We take this as an opportunity to decouple content blocked messages
and storage access blocked ones, as they have slightly different
meanings and consequences.

Tests are updated to match the new labels, and a new test is
added to make sure that we can have multiple warning group in a
single "page navigation" session.

Differential Revision: https://phabricator.services.mozilla.com/D34339
2019-06-11 13:47:37 +00:00
Julian Descottes 8632e22fe8 Bug 1553214 - add fallback value for pageError.cssSelectors r=pbro
Differential Revision: https://phabricator.services.mozilla.com/D33069
2019-05-31 08:11:13 +00:00
Patrick Brosset d93842478f Bug 1553451 - Lower the eslint complexity level to 20 for devtools and exlude more complex functions; r=jdescottes
We want to go back to ESLint's default complexity level so that newly introduced code is checked for complexity.
At the same time, to make that work, we're excluding all of the more complex functions for now.
We should fix them: make them less complex, and remove the eslint-disable comment.
See bug 1553449 for more information about this.

Differential Revision: https://phabricator.services.mozilla.com/D32139
2019-05-23 09:06:16 +00:00
Mihai Alexandru Michis c358baf0c3 Backed out changeset 0f9626b48a66 (bug 1553451) for linting failures. CLOSED TREE 2019-05-23 10:58:22 +03:00
Patrick Brosset 18bd75fb8c Bug 1553451 - Lower the eslint complexity level to 20 for devtools and exlude more complex functions; r=jdescottes
We want to go back to ESLint's default complexity level so that newly introduced code is checked for complexity.
At the same time, to make that work, we're excluding all of the more complex functions for now.
We should fix them: make them less complex, and remove the eslint-disable comment.
See bug 1553449 for more information about this.

Differential Revision: https://phabricator.services.mozilla.com/D32139
2019-05-23 07:07:49 +00:00
Christoph Walcher 27e4395f18 Bug 1530138 - Added resend option in WebConsole r=nchevobbe,Honza
Added resend option in WebConsole

Differential Revision: https://phabricator.services.mozilla.com/D30779
2019-05-14 12:47:08 +00:00
Brian Hackett c1a6ebf2f4 Bug 1230194 Part 2 - Show stack for console evaluations that throw something, r=nchevobbe.
Differential Revision: https://phabricator.services.mozilla.com/D27827
2019-04-16 11:51:52 -10:00
Razvan Caliman 4c1405c671 Bug 1093953 - (Part 1) Make CSS warnings expandable to show affected DOM elements. r=Honza
This patch builds on [Bug 1537876](https://bugzilla.mozilla.org/show_bug.cgi?id=1537876) which associates CSS selectors with error messages where applicable.

This patch introduces a new React component, `CSSWarning`, for messages of type CSS. It forks the`PageError` component which was shared for `LOG` messages of type `JAVASCRIPT` and type `CSS`.

The `CSSWarning` component is expandable when the message has an associated CSS selector. When expanded, it runs a `document.querySelectorAll()` command to list all elements matching the selector. Clicking on any of the elements in the result jumps to the Inspector and select the corresponding node in the markup view.

Not all errors have associated CSS selectors. Not all selectors match elements. The errors/warnings are a result of the CSS Parser; there is no guarantee that the CSS rule is used anywhere on the document. The query may return an empty `NodeList`.

Differential Revision: https://phabricator.services.mozilla.com/D28457
2019-05-03 13:01:27 +00:00
Nicolas Chevobbe 69c3e15e10 Bug 1260877 - Add a chromeContext property to ConsoleMessage. r=bgrins.
This property was already in console api message packet,
and this patch also adds it to pageError packets (retrieving
it from nsIScriptError.isFromChromeContext).

Stubs are updated to include the new property.

Differential Revision: https://phabricator.services.mozilla.com/D26336
2019-04-16 09:08:34 +00:00
Razvan Maries d16edcade6 Backed out 3 changesets (bug 1260877) for perma dt fails on devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_page_error.js. CLOSED TREE
Backed out changeset 10fd2d1f0fa2 (bug 1260877)
Backed out changeset e4f28c656165 (bug 1260877)
Backed out changeset 17059c813d40 (bug 1260877)
2019-04-16 10:09:37 +03:00
Nicolas Chevobbe 361ca68cf0 Bug 1260877 - Add a chromeContext property to ConsoleMessage. r=bgrins.
This property was already in console api message packet,
and this patch also adds it to pageError packets (retrieving
it from nsIScriptError.isFromChromeContext).

Stubs are updated to include the new property.

Differential Revision: https://phabricator.services.mozilla.com/D26336
2019-04-16 05:32:34 +00:00
Nicolas Chevobbe 737400a866 Bug 1524276 - Group content blocking messages. r=bgrins,Honza.
If there's at least 2 content blocking messages displayed
for a given page navigation, we display a warning group
containing the messages, collapsed by default.
This means we need to move or insert those warning messages
at the right position in visibleMessages, either when they're
added, or when we expand a group.
Two mochitest are added to make sure this works as expected,
one for generic warningGroup features (expanding, group per
navigation session, …), and another one specifically for
content blocking warning group, where we check that every
type of content blocking message can be grouped.

The grouping won't occur unless the groupWarnings preferences
is on.

Differential Revision: https://phabricator.services.mozilla.com/D23552
2019-03-30 11:09:21 +00:00
Nicolas Chevobbe c532c28635 Bug 1524276 - Add WarningGroup message component. r=bgrins.
This component will be used to render warning groups messages.
We also add a `inWarningGroup` prop to the `Message` component
so warnings that will be displayed in such warningGroup can
be styled differently (no warning icon, a different color for
the indent).
Add some utils functions and constants to check if a message
should be a warning group.

Differential Revision: https://phabricator.services.mozilla.com/D23551
2019-03-30 11:08:56 +00:00
Nicolas Chevobbe 8c985acc0f Bug 1524276 - Expose category and innerWindowID properties in ConsoleMessage. r=bgrins.
This will be used to group similar messages together.
Stubs are updated.

Differential Revision: https://phabricator.services.mozilla.com/D23549
2019-03-30 11:07:56 +00:00