Commit Graph
75 Commits
Author SHA1 Message Date
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
Daniel Varga fc6b4f5345 Backed out 4 changesets (bug 1524276) for mochitest-devtools at devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js. On a CLOSED TREE
Backed out changeset 78fb95dc20e3 (bug 1524276)
Backed out changeset 30570673a894 (bug 1524276)
Backed out changeset 9476f9253c9c (bug 1524276)
Backed out changeset 6f1c417146be (bug 1524276)
2019-03-29 17:48:19 +02:00
Nicolas Chevobbe d568dc3c1c 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-29 14:19:50 +00:00
Nicolas Chevobbe 84905d5c17 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-29 14:18:18 +00:00
Nicolas Chevobbe fd0291c4f3 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-29 14:17:03 +00:00
Daniel Varga dc805f349c Backed out 4 changesets (bug 1524276) for mochitest-devtools failure at devtools/client/webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js. On a CLOSED TREE
Backed out changeset 47363a80ef6d (bug 1524276)
Backed out changeset 1fee0c357772 (bug 1524276)
Backed out changeset 8bbe3e4f5a54 (bug 1524276)
Backed out changeset d21159afd969 (bug 1524276)
2019-03-29 13:47:46 +02:00
Nicolas Chevobbe b9767a6f31 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-29 08:04:24 +00:00
Nicolas Chevobbe 90a57489aa 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-29 08:03:59 +00:00
Nicolas Chevobbe 5aa90fe868 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-29 08:03:15 +00:00
Helena Moreno a4e08aa641 Bug 1534301 - Pass a timestamp property when creating a navigation marker message. r=nchevobbe.
This allow the timeStamp to be properly displayed in the console output.

Differential Revision: https://phabricator.services.mozilla.com/D23148
2019-03-18 17:55:09 +00:00
Brian Hackett 1ac9b8ac92 Bug 1530133 Part 2 - Allow clearing console messages by their logpoint ID, r=nchevobbe. 2019-02-23 16:19:17 -10:00
bomisore 7c46baeb45 Bug 1463347 - Add distinction between timeLog and timeEnd messages r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D21306
2019-03-04 17:12:47 +00:00
fanny f824037386 Bug 1457111 - Implement copy link adress option. r=nchevobbe
Before this change, when we tried to select a URL to copy,
the label "Copy Message" or "Copy Object" was displayed which
does not represent the context. You can now detect if a link exists
and the label is "Copy link address"

Differential Revision: https://phabricator.services.mozilla.com/D21136
2019-03-04 10:36:11 +00:00
Coroiu Cristina 752a467776 Backed out changeset 0d9daf8104d7 (bug 1463347) for devtools failures at webconsole/test/fixtures/stub-generators/browser_webconsole_check_stubs_console_api.js 2019-03-04 13:12:13 +02:00
bomisore 5b35f76897 Bug 1463347 - Add distinction between timeLog and timeEnd messages r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D21306
2019-03-04 09:23:24 +00:00
saumya 4e4499859e Bug 1470253 - Don't show console.timeStamp() messages. r=nchevobbe
Made changes to messages.js and added a test file.

Differential Revision: https://phabricator.services.mozilla.com/D21330
2019-02-27 13:42:11 +00:00
Nicolas Chevobbe 8a8d018dff Bug 1463128 - Expose setInputValue and getInputValue at hud level; r=Honza.
Now that the JsTerm is a React component, we shouldn't
let external consumers have to get the instance in order
to perform some actions on the console input.
We start with the most used actions, setInputValue and getInputValue,
and might extend that in the future.

Differential Revision: https://phabricator.services.mozilla.com/D20685
2019-02-27 10:09:35 +00:00
Gurzau Raul 3ee8fd7ce9 Backed out 5 changesets (bug 1463128) for failing at webconsole/autocomplete.js on a CLOSED TREE.
Backed out changeset 31a85e2ed53e (bug 1463128)
Backed out changeset fcd93f64c934 (bug 1463128)
Backed out changeset ae460b3a30c2 (bug 1463128)
Backed out changeset 97a1eeb8db65 (bug 1463128)
Backed out changeset c504e9730eac (bug 1463128)
2019-02-27 00:19:15 +02:00
Nicolas Chevobbe 6ac4e9955c Bug 1463128 - Expose setInputValue and getInputValue at hud level; r=Honza.
Now that the JsTerm is a React component, we shouldn't
let external consumers have to get the instance in order
to perform some actions on the console input.
We start with the most used actions, setInputValue and getInputValue,
and might extend that in the future.

Differential Revision: https://phabricator.services.mozilla.com/D20685
2019-02-26 14:42:13 +00:00
Brian Hackett fa5e9ef447 Bug 1447244 Part 7 - Devtools client changes for script source IDs, r=lsmyth. 2019-01-16 12:01:33 -10:00
Brian Hackett 957bd3fc6f Bug 1526561 - Don't show messages with different execution points as repeated, r=nchevobbe. 2019-02-08 14:38:19 -10:00
Nicolas Chevobbe c3ec87944a Bug 1527834 - Rename WebConsoleWrapper:hud to WebConsoleWrapper:webConsoleUI; r=bgrins.
This better reflects what the property is (i.e. a
WebConsoleUI instance), and avoid confusion with
the panel's hud (created in webconsole.js).
We take that as an opportunity to clean things up
a bit (e.g. don't access the webConsoleUI through
JsTerm).

Differential Revision: https://phabricator.services.mozilla.com/D19783
2019-02-15 08:17:43 +00:00
Nicolas Chevobbe 9209539c17 Bug 1525682 - Add errorMessageName in ConsoleMessage; r=bgrins.
This will be used in telemetry events. Also,
we add `errorMessageName` in evaluation result packets.
Stubs are generated so they include the new property.

Differential Revision: https://phabricator.services.mozilla.com/D18925
2019-02-11 17:22:12 +00:00
Nicolas Chevobbe faac1d90bd Bug 1525332 - Lazy load components and modules we don't need right away at console initialization; r=Honza.
There was quite some file that was required directly
but that may not be used until later (or maybe never),
which means we were doing extra work.
Lazily loading those files seems to improve opening
time significantly.

Differential Revision: https://phabricator.services.mozilla.com/D18819
2019-02-06 14:00:59 +00:00
Nicolas Chevobbe 290769a425 Bug 1522901 - Include packet.stacktrace when computing repeatId; r=julienw.
This was causing an issue with console.trace calls
triggered from different paths (i.e. the message
was repeated in the console, only showing the first
stacktrace).
This fixes the issue, and a test is added to
ensure we don't regress this.
This also revealed an erroneous test where we were
asserting the buggy behavior.
Doing this modifies the message shape, so we also
need to update the stubs.

Differential Revision: https://phabricator.services.mozilla.com/D18094
2019-01-31 14:22:53 +00:00
Nicolas Chevobbe b230bb5024 Bug 1486870 - Fix copy/pasting stacktraces in console; r=bgrins.
The changes were made in Github to have proper markup for the
SmartTrace component. In the console, we change how the "Copy Message"
and "Export visible messages" context menu actions work so they use
the Selection API instead of `element.textContent`.
The Selection API reflects what would happen if a user do a text
selection, so having our actions to do the same ensure that we keep
our markup suitable for the clipboard.

Differential Revision: https://phabricator.services.mozilla.com/D17378
2019-01-25 17:16:10 +00:00
Alexandre Poirot 8d5975f5fb Bug 1520771 - Remove navPayload from will-navigate/navigate events. r=nchevobbe
It looks like a relic of the ancient times, probably specific to non-e10s codepath
which degraded over time and there is still a couple of leftover here and there.

For now the output wrapper was passing over the will-navigate event and make it so
that it looked like a "cached" packet. Which it isn't.
So instead, flag a meaningful "type" attribute and handle this packet directly in
transformPacket.

Differential Revision: https://phabricator.services.mozilla.com/D16871
2019-01-21 15:19:32 +00:00
Jefry Lagrange ad0312ad65 Bug 644412 - Export all data from Web Console to clipboard. r=nchevobbe 2019-01-14 11:02:51 +01:00
Nicolas Chevobbe 143d2b1205 Bug 1514815 - Keep console scrolled to bottom when rendering SmartTrace; r=bgrins.
Differential Revision: https://phabricator.services.mozilla.com/D15010
2018-12-20 14:37:41 +00:00
arthur.iakab ae3cf334a1 Backed out 2 changesets (bug 1514815) for failing devtools on browser_console_consolejsm_output.js CLOSED TREE
Backed out changeset d822219ea9bc (bug 1514815)
Backed out changeset 209bdfcecdc9 (bug 1514815)
2018-12-20 16:00:32 +02:00