Commit Graph

929 Commits

Author SHA1 Message Date
Armando Ferreira
a22a750ddc Bug 1558198 - Add history navigation buttons in Editor toolbar. r=nchevobbe
Adding History navigation to Editor toolbar

Differential Revision: https://phabricator.services.mozilla.com/D38951

--HG--
extra : moz-landing-system : lando
2019-07-23 18:36:01 +00:00
Armando Ferreira
237ff71915 Bug 1540722 - Copy link location should work for learn-more links. r=nchevobbe
Support for coping link location from within the Console panel (through the context menu) can be extended and cover learn more links too.

Differential Revision: https://phabricator.services.mozilla.com/D38546

--HG--
extra : moz-landing-system : lando
2019-07-23 18:34:08 +00:00
Alexandre Poirot
75662cc393 Bug 1567760 - Fix OOM failures in browser_webconsole_inspect_cross_domain_object.js. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D38985

--HG--
extra : moz-landing-system : lando
2019-07-23 17:01:28 +00:00
Tom Schuster
4e4dbeff23 Bug 1523706 - Extend devtools test. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D37912

--HG--
extra : moz-landing-system : lando
2019-07-23 09:47:03 +00:00
Razvan Maries
86980b4bb2 Merge mozilla-inbound to mozilla-central a=merge 2019-07-23 00:37:54 +03:00
Gabriel Luong
19aca80c51 Bug 1567276 - Refactor inspector to inspectorFront. r=rcaliman
Differential Revision: https://phabricator.services.mozilla.com/D38554
2019-07-18 15:33:55 -04:00
Sebastian Streich
d19c155e9e Bug 1100630 - Print Related JS-Line on CSP Violation (if any) r=ckerschb,dveditz
Differential Revision: https://phabricator.services.mozilla.com/D31420

--HG--
extra : moz-landing-system : lando
2019-07-22 09:31:57 +00:00
Nicolas Chevobbe
41b44a849a Bug 1567370 - Add a close button to the Editor Toolbar. r=Honza.
The button display the same icon that will be used
in the console input when in inline-mode to toggle
the editor mode, active.
A test is added to ensure the button works as expected.

Differential Revision: https://phabricator.services.mozilla.com/D38622

--HG--
rename : browser/themes/shared/icons/sidebars.svg => devtools/client/themes/images/webconsole/editor.svg
extra : moz-landing-system : lando
2019-07-19 14:10:06 +00:00
Ciure Andrei
b6b6dbdb5d Bug 1560261 - disable browser_webconsole_warning_groups_filtering.js on windows 7 opt for frequent failures. r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D38091

--HG--
extra : moz-landing-system : lando
2019-07-17 17:55:59 +00:00
Eden Chuang
2e2e393e21 Bug 1561930 - Correct the wrong attribute isFromChromeContext value for chrome context messages from Cu.reportError r=baku
Differential Revision: https://phabricator.services.mozilla.com/D38464

--HG--
extra : moz-landing-system : lando
2019-07-18 21:49:30 +00:00
Noemi Erli
0497bd7b16 Backed out changeset a98b795c2b3c (bug 1100630) for Linting failure CLOSED TREE 2019-07-18 19:19:48 +03:00
Sebastian Streich
fa947e166a Bug 1100630 - Print Related JS-Line on CSP Violation (if any) r=ckerschb,dveditz
Differential Revision: https://phabricator.services.mozilla.com/D31420

--HG--
extra : moz-landing-system : lando
2019-07-18 15:14:41 +00:00
Nicolas Chevobbe
bffc60754d Bug 1565781 - Fix ConsoleTable with nested holey array. r=Honza.
A test is added to ensure this is fixed properly.
We also fix the Array previewer to properly return
undefined for unknown array properties, rather than null.

Differential Revision: https://phabricator.services.mozilla.com/D38467

--HG--
extra : moz-landing-system : lando
2019-07-18 12:04:42 +00:00
Nicolas Chevobbe
f2fd01c611 Bug 1567082 - Fix console table overflow. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D38466

--HG--
extra : moz-landing-system : lando
2019-07-18 11:58:16 +00:00
Nicolas Chevobbe
73adf5f4f8 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

--HG--
extra : moz-landing-system : lando
2019-07-18 05:51:44 +00:00
Nicolas Chevobbe
a22dc0fd39 Bug 1565962 - Refactor webconsole layout. r=Honza.
Since we now have a GridElementWidthResizer element, we can
get rid of the SplitBox wrapping the SideBar, and have all
major elements as child of the App element, controlled by
a CSS Grid.

This makes it easy to change the console layout when toggling
the editor mode (re-ordering element in JS, changing the CSS
grid templates, and placing the element in different areas).
This also means we can take advantage of subgrid to align
the sidebar toolbar with the filter bar for example.

As the part of the stylesheet dedicated to layout grew, it
made sense to have it all in a separate stylesheet, App.css,
that lives next to the App component.

Differential Revision: https://phabricator.services.mozilla.com/D38038

--HG--
rename : devtools/client/themes/webconsole.css => devtools/client/webconsole/components/App.css
extra : moz-landing-system : lando
2019-07-18 09:02:46 +00:00
Ciure Andrei
d835b44a76 Merge inbound to mozilla-central. a=merge 2019-07-18 06:46:41 +03:00
Kris Maglione
0962c2b731 Bug 1566182: Annotate mochitests that fail with Fission enabled. r=mccr8
My preference was to annotate most of the failing tests with `fail-if` so that
if they start passing, the `fail-if` needs to be removed and they need to keep
passing. That doesn't work for tests that timeout, or which trigger failures
from their cleanup functions, however, so those tests need skip-if. And tests
with fail in their cleanup functions likely leave the browser in an
inconsistent state for subsequent tests, anyway, so really should be skipped
regardless.

There are some remaining tests which still fail because of crashes. I chose
not to skip them here, but to fix the crashes in separate bugs instead.

Differential Revision: https://phabricator.services.mozilla.com/D38247

--HG--
extra : rebase_source : 39ba8fec2e882cfe577c5f2b58ab7e4b461f1178
2019-07-15 16:19:32 -07:00
Benjamin
7cd76c27d8 Bug 1566149: Added test to ensure CSP 'navigate-to' does not parse r=ckerschb
The test sets a navigate-to policy which results in a parse error.

Differential Revision: https://phabricator.services.mozilla.com/D38221

--HG--
extra : moz-landing-system : lando
2019-07-17 18:16:47 +00:00
Alexandre Poirot
c57a4aea23 Bug 1543023 - Use ChromeUtils.import only with one argument in all /devtools/ r=jdescottes
ChromeUtils.import still support a second argument as it used to do
when it was Components.utils.import. But this is deprecated and we should
instead always use the returned value.

Differential Revision: https://phabricator.services.mozilla.com/D37708

--HG--
extra : moz-landing-system : lando
2019-07-11 17:08:20 +00:00
yulia
cc00bf541b Bug 1559819 - rename threadClient to threadFront; r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D32848

--HG--
rename : devtools/client/debugger/src/actions/tests/helpers/threadClient.js => devtools/client/debugger/src/actions/tests/helpers/threadFront.js
rename : devtools/shared/client/thread-client.js => devtools/shared/fronts/thread.js
extra : moz-landing-system : lando
2019-07-11 09:45:32 +00:00
Panos Astithas
b290fc08af Bug 1233891 - Use DOM promises instead of deprecated sync promises in devtools/. r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D37138

--HG--
extra : moz-landing-system : lando
2019-07-09 17:26:32 +00:00
Nicolas Chevobbe
c263325eba Bug 1564363 - Close the network detail on Escape. r=Honza.
We use the openNetworkDetails prop which is already in use
in the netmonitor to collapse the message if the parameter
passed to the function is falsy (i.e. the panel is already
displayed)

Depends on D37388

Differential Revision: https://phabricator.services.mozilla.com/D37389

--HG--
extra : moz-landing-system : lando
2019-07-09 10:50:50 +00:00
Nicolas Chevobbe
064fd41499 Bug 1534706 - Don't focus ConfirmDialog when displaying it. r=Honza
Some people found that the ConfirmDialog was getting into their
way when typing into the console, as it was stealing the focus.
This patch fixes this by not focusing the ConfirmDialog when
we show it, so the user can still type.
This means that we now handle the dialog confirm and dismiss from
JSTerm, when the former is displayed.

Since it wasn't clear how you could close the popup, we add a close
button that makes it very obvious.

This means we can drop the key handler in the dialog as the jsterm
is always focused.
We also simply remove the feature to open the MDN link on `?` key
stroke as it's not discoverable and was the only part of the
panel where you could do such thing.

Existing tests are adapted and extended to cover the new behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D36174

--HG--
extra : moz-landing-system : lando
2019-07-09 12:28:38 +00:00
Nicolas Chevobbe
a0d642a0a5 Bug 1563914 - Fix ConsoleTable with invalid headers. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D37164

--HG--
extra : moz-landing-system : lando
2019-07-09 08:47:58 +00:00
Jonathan Kingston
31441f82ea Bug 1560455 - rename CodebasePrincipal to ContentPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35504

--HG--
extra : moz-landing-system : lando
2019-07-08 16:37:45 +00:00
Noemi Erli
ba301c3e5e Bug 1563684 - ES lint fix CLOSED TREE 2019-07-08 16:12:34 +03:00
Nicolas Chevobbe
875a819a93 Bug 1563684 - Fix blank console on GMail. r=yulia.
The console fails to connect to the server because
the getCachedMessages function throws on GMail.
This is because we try to access a property on a
cross-origin object, window.windowUtils, in
getInnerWindowId.
Wrapping the access to the property fixes the issue.
A test is added to make sure we don't regress.

// TODO: The test isn't failing without the fix,
so it should be re-written.

Differential Revision: https://phabricator.services.mozilla.com/D37069

--HG--
extra : moz-landing-system : lando
2019-07-08 12:34:20 +00:00
Coroiu Cristina
a456952e71 Backed out changeset 8b0c5e44d937 (bug 1100630) for wpt failures at securitypolicyviolation/securitypolicyviolation-block-cross-origin-image-from-script.sub.html on a CLOSED TREE 2019-07-17 17:10:03 +03:00
Sebastian Streich
975121a09a Bug 1100630 - Print Related JS-Line on CSP Violation (if any) r=ckerschb,dveditz
Differential Revision: https://phabricator.services.mozilla.com/D31420

--HG--
extra : moz-landing-system : lando
2019-07-17 10:54:07 +00:00
Coroiu Cristina
0fddb5f0fd Backed out changeset ffc9fe173b43 (bug 1566149) for ESlint failure on a CLOSED TREE 2019-07-17 10:18:26 +03:00
Benjamin
8e6a440fe8 Bug 1566149: Added test to ensure CSP 'navigate-to' does not parse r=ckerschb
The test sets a navigate-to policy which results in a parse error.

Differential Revision: https://phabricator.services.mozilla.com/D38221

--HG--
extra : moz-landing-system : lando
2019-07-16 19:12:17 +00:00
Victor Porof
60b8254b35 Bug 1561435 - Update pageError stubs file after formatting devtools/client/ by running browser_webconsole_update_stubs_page_error.js, r=standard8
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35890

--HG--
extra : source : e550cb2590583e0978a183813069197d65bb4b9e
extra : intermediate-source : 39a13b35139e3d3f7be072a51674e125ff798c66
2019-06-28 23:03:19 +02:00
Victor Porof
f6db0ee557 Bug 1561435 - Format devtools/client/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35884

--HG--
extra : source : 60e4496cf9699dc59f2f4738cb60f87cbdb01e67
2019-07-05 11:24:38 +02:00
Victor Porof
57a6febcec Bug 1561435 - Update pageError stubs file after formatting testing/ by running browser_webconsole_update_stubs_page_error.js, r=standard8
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D36412

--HG--
extra : source : ef0ac7e1af4307bd0e8fbefbce2f05a647cde9be
extra : intermediate-source : d05c283a1ffde68231f668ef0c1359c422c5bdbc
2019-06-28 22:48:16 +02:00
Razvan Caliman
0bde9bbef6 Bug 724505 - Map minified CSS to prettyfied CSS. r=gl
Ensure source links for selectors in the Rules view and warning links in Web Console for minified CSS go to the right location in the Style Editor after applying automatic prettification.

This only works for linked stylesheets. [Bug 1169770](https://bugzilla.mozilla.org/show_bug.cgi?id=1169770) needs to be fixed first before this can work correctly on inline minified stylesheets.

This patch augments the `prettifyCSS()` method to generate the mappings necessary to generate a sourcemap from the original to the prettified source. It uses these mappings to translate the cursor position when invoking the Style Editor to be opened at a specific location.

The mappings from the minified to the prettified source are used only until the stylesheet is changed in the Style Editor. Upon editing the source in the Style Editor, the associated mappings are cleared because it's likely they have been rendered invalid.

The updated stylesheet will already be prettified so it bypasses the `prettifyCSS()` method, thus avoiding the need to re-generate mappings. New CSS warnings will be listed in the Web Console which point to the right location in the edited stylesheet (the old warnings no longer point to the right place, but that's an acceptable side-effect). The Rules view in the Inspector also lists selectors with the new positions within the edited stylesheet.

Differential Revision: https://phabricator.services.mozilla.com/D36585

--HG--
extra : moz-landing-system : lando
2019-07-04 17:30:00 +00:00
Nicolas Chevobbe
ea96bb70c8 Bug 1562839 - Put editor mode behind a pref. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D36582

--HG--
extra : moz-landing-system : lando
2019-07-03 11:14:22 +00:00
Bryan Kok
b425bf8630 Bug 1519315 - Display CodeMirror's gutter in console input when devtools.webconsole.input.editor is true. r=Honza.
Differential Revision: https://phabricator.services.mozilla.com/D33995

--HG--
extra : moz-landing-system : lando
2019-06-28 16:27:55 +00:00
Nicolas Chevobbe
4257b47fac Bug 1519105 - Add a keyboard shortcut to switch between inline and editor mode. r=Honza.
We use Cmd/Ctrl + B to switch between inline and editor mode. This
should be familiar for VSCode users as it toggles the file sidebar.
When changing the layout, we persist the choice into the editor pref
so the user keeps the same layout the next time they open the console.

Differential Revision: https://phabricator.services.mozilla.com/D34718

--HG--
extra : moz-landing-system : lando
2019-06-28 09:25:59 +00:00
Nicolas Chevobbe
66150262ef Bug 1519312 - Render the console input to the left of the panel when editor preference is true; r=Honza.
When the editor preference is true, a CSS class is added to
the panel that allow us to shift the layout to a CSS Grid, where
the input panel is on the left and the output on the right.

A toolbar is added to be able to execute an expression when in
editor mode.

Differential Revision: https://phabricator.services.mozilla.com/D17096

--HG--
extra : moz-landing-system : lando
2019-06-27 13:13:32 +00:00
Jefry Lagrange
bd7874038e 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

--HG--
extra : moz-landing-system : lando
2019-06-28 08:28:53 +00:00
Nicolas Chevobbe
68245b3595 Bug 1548866 - Fix intermittent failure on browser_webconsole_keyboard_accessibility.js. r=jdescottes.
The failure was happening on window7, which I guess is
pretty slow. Looking at the failure screenshot I was able
to see that the console output was empty.
The test is initially waiting for a 100 messages to be displayed
in the console output.
We are using the waitFor helper function for that. waitFor by default
call the function argument 500 times, at a 10ms interval, and then
fail.
Here, we bump the interval to 100ms, and set the max number of
tries to 500, in order to give extra time for the 100 messages
to be rendered in the output.

Pushed a TV job a re-ran it a few times without seeing the failure,
so the fix should be good.

Differential Revision: https://phabricator.services.mozilla.com/D36039

--HG--
extra : moz-landing-system : lando
2019-06-27 12:45:56 +00:00
Nicolas Chevobbe
c1f5c82eda Bug 1560320 - Dismiss autocomplete on Ctrl+A on OSX. r=Honza.
Ctrl + A moves the cursor to the beginning of the line,
so we need to dismiss autocomplete.
A test case is added to make sure this behaves as
expected.

Differential Revision: https://phabricator.services.mozilla.com/D35573

--HG--
extra : moz-landing-system : lando
2019-06-27 11:48:34 +00:00
Nicolas Chevobbe
06b2ed9350 Bug 1559329 - Set "group similar messages" to true by default. r=Honza.
This was making browser_webconsole_scroll.js fail.
After some investigation, I found that the `isInWarningGroup`
prop, a function defined in `mapStateToProp` was causing a
re-rendering (because we were creating a new function each
time), impacting the shouldScrollToBottom behaviour.

To fix this, we no longer create a `isInWarningGroup` prop,
but directly use the `isMessageInWarningGroup` selector, which
was modified to take an array of visible messages instead of
the whole state.

Differential Revision: https://phabricator.services.mozilla.com/D35016

--HG--
extra : moz-landing-system : lando
2019-06-27 11:42:15 +00:00
Nicolas Chevobbe
81c6695582 Bug 1559335 - Fix messages ordering when 2 messages have the same timestamp. r=Honza.
If 2 messages are emitted during the same microsecond,
their timestamps are similar, and the sorting we do when
filtering for warning groups might be erroneous.
In such case, we now check the message id, to see which
one we handled first, which should be enough.

A test is added to ensure this works as expected. Basically,
we now render 2 logs one after the another, to increase the
chance they'll get the same timestamp.
The updated test was failing without the fix, and seems to
pass with it.

Differential Revision: https://phabricator.services.mozilla.com/D35015

--HG--
extra : moz-landing-system : lando
2019-06-27 11:41:56 +00:00
Armando Ferreira
a7e460857f Bug 1522104 - Re-organise devtools/client/webconsole/components/ folder. r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D35932

--HG--
rename : devtools/client/webconsole/components/FilterBar.js => devtools/client/webconsole/components/FilterBar/FilterBar.js
rename : devtools/client/webconsole/components/FilterButton.js => devtools/client/webconsole/components/FilterBar/FilterButton.js
rename : devtools/client/webconsole/components/FilterCheckbox.js => devtools/client/webconsole/components/FilterBar/FilterCheckbox.js
rename : devtools/client/webconsole/components/ConfirmDialog.js => devtools/client/webconsole/components/Input/ConfirmDialog.js
rename : devtools/client/webconsole/components/JSTerm.js => devtools/client/webconsole/components/Input/JSTerm.js
rename : devtools/client/webconsole/components/ReverseSearchInput.css => devtools/client/webconsole/components/Input/ReverseSearchInput.css
rename : devtools/client/webconsole/components/ReverseSearchInput.js => devtools/client/webconsole/components/Input/ReverseSearchInput.js
rename : devtools/client/webconsole/components/CollapseButton.js => devtools/client/webconsole/components/Output/CollapseButton.js
rename : devtools/client/webconsole/components/ConsoleOutput.js => devtools/client/webconsole/components/Output/ConsoleOutput.js
rename : devtools/client/webconsole/components/ConsoleTable.js => devtools/client/webconsole/components/Output/ConsoleTable.js
rename : devtools/client/webconsole/components/GripMessageBody.js => devtools/client/webconsole/components/Output/GripMessageBody.js
rename : devtools/client/webconsole/components/Message.js => devtools/client/webconsole/components/Output/Message.js
rename : devtools/client/webconsole/components/MessageContainer.js => devtools/client/webconsole/components/Output/MessageContainer.js
rename : devtools/client/webconsole/components/MessageIcon.js => devtools/client/webconsole/components/Output/MessageIcon.js
rename : devtools/client/webconsole/components/MessageIndent.js => devtools/client/webconsole/components/Output/MessageIndent.js
rename : devtools/client/webconsole/components/MessageRepeat.js => devtools/client/webconsole/components/Output/MessageRepeat.js
rename : devtools/client/webconsole/components/message-types/CSSWarning.js => devtools/client/webconsole/components/Output/message-types/CSSWarning.js
rename : devtools/client/webconsole/components/message-types/ConsoleApiCall.js => devtools/client/webconsole/components/Output/message-types/ConsoleApiCall.js
rename : devtools/client/webconsole/components/message-types/ConsoleCommand.js => devtools/client/webconsole/components/Output/message-types/ConsoleCommand.js
rename : devtools/client/webconsole/components/message-types/DefaultRenderer.js => devtools/client/webconsole/components/Output/message-types/DefaultRenderer.js
rename : devtools/client/webconsole/components/message-types/EvaluationResult.js => devtools/client/webconsole/components/Output/message-types/EvaluationResult.js
rename : devtools/client/webconsole/components/message-types/NetworkEventMessage.js => devtools/client/webconsole/components/Output/message-types/NetworkEventMessage.js
rename : devtools/client/webconsole/components/message-types/PageError.js => devtools/client/webconsole/components/Output/message-types/PageError.js
rename : devtools/client/webconsole/components/message-types/WarningGroup.js => devtools/client/webconsole/components/Output/message-types/WarningGroup.js
rename : devtools/client/webconsole/components/message-types/moz.build => devtools/client/webconsole/components/Output/message-types/moz.build
extra : moz-landing-system : lando
2019-06-26 09:19:54 +00:00
Nicolas Chevobbe
85b42f62ab Bug 1358983 - Fix zombie highlighters. r=miker.
Due to how highlighters work, it requires the inspector to be initialized.
It can happen than the user will mouseenter/mouseout on an element that
calls highlight/unhighlight very quickly.
Since the hightlight can take some time, it might happen that the unhighlight
call is handled first, before the highlight call, meaning that we now have an
highlighter displayed, even though the user isn't hovering anything that
should cause this anymore.

This patch introduces a new toolbox function called `getHighlighter` that
returns an object with a `highlight and a `unhighlight` function.
We keep a reference to any possible pending `highlight` call so we can wait
for it to be done in `unhighlight`, before destroying it.

The console makes use of the new helper function, and a test is added to ensure
we don't have zombie highlighters anymore.

Differential Revision: https://phabricator.services.mozilla.com/D34562

--HG--
extra : moz-landing-system : lando
2019-06-21 22:15:57 +00:00
tanhengyeow
1f04945904 Bug 1555625 - Basic skeleton of side panel for WS frames. r=Honza
Implement basic skeleton of side panel for WS frames.

Differential Revision: https://phabricator.services.mozilla.com/D34704

--HG--
extra : moz-landing-system : lando
2019-06-19 20:00:30 +00:00
Nicolas Chevobbe
9ca9ab3f7f Bug 1553356 - Fix browser_webconsole_warning_groups_filtering.js intermittent. r=Ola.
The failures indicated that some warning messages
were placed before the navigation marker, when they
should be placed after.
We now listen to the `load` event instead of `DOMContentLoaded`
to ensure the page is fully loaded and the warning gets
reported into the right page session.

Differential Revision: https://phabricator.services.mozilla.com/D35014

--HG--
extra : moz-landing-system : lando
2019-06-19 12:07:37 +00:00
Brendan Dahl
ccb8b2f945 Bug 1558674 - Allow chrome privileged documents to enable/disable copy/paste. r=Ehsan,bgrins
For content HTML/XHTML copy/paste should always be enabled, but for chrome
docs we can support enabling/disabling copy/paste.

Also, restores tests to how they were before copy/paste was always enabled.

Differential Revision: https://phabricator.services.mozilla.com/D34805

--HG--
extra : moz-landing-system : lando
2019-06-18 20:40:19 +00:00