The live expression editor in the Console tab didn't commit the live
expression when hitting 'Enter', but was adding new lines instead. That
was quite different from other parts of the DevTools UI. Instead the
user would have to hit 'Ctrl-Enter'. This CL changes the editor to also
commit on 'Enter' (leaving the 'Ctrl-Enter' shortcut as well for now).
Fixed: chromium:1260744
Change-Id: I1cf54f26508be43cc8f6ffb915c577898bc6df93
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3563077
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Danil Somsikov <dsv@chromium.org>
This limits the max depth for 'Expand recursively' in the objects UI
(primarily in the Console tab) to 100 and also adds some smarts to the
component to not expand [[Prototype]] this way, as that's very likely
not what the developer had in mind.
Fixed: chromium:1272450
Bug: chromium:1199286
Change-Id: Id96a57051c05c3cb8448c52c687d08ae72eddf0f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3553118
Auto-Submit: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
This reverts commit 1b596f3b4b.
Reason for revert: closed the tree, more blink tests to adapt
Original change's description:
> Enable synchronization on instrumentation breakpoints
>
> This CL introduces the synchronization point for setting
> breakpoints on new scripts using instrumentation breakpoints.
>
> Instrumentation breakpoints will trigger at the first statement
> of a newly run script. Afterwards we wait for all resources
> that we need to set a breakpoint (if one is cached for that
> particular script), set it, and resume.
>
> Note: this will not correctly synchronize the case where we
> just opened DevTools or just created a new target, as at this
> point some scripts might have started running. For this, we
> need to synchronize the Debugger.enable call, which is something
> that is left to take care of.
>
> Bug: chromium:1229541, chromium:1133307, chromium:1300509
> Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
> Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
> Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I9eccdf065820854746ec7ad4643362859c9960e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3506653
Auto-Submit: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Johan Bay <jobay@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Owners-Override: Kim-Anh Tran <kimanh@chromium.org>
This CL introduces the synchronization point for setting
breakpoints on new scripts using instrumentation breakpoints.
Instrumentation breakpoints will trigger at the first statement
of a newly run script. Afterwards we wait for all resources
that we need to set a breakpoint (if one is cached for that
particular script), set it, and resume.
Note: this will not correctly synchronize the case where we
just opened DevTools or just created a new target, as at this
point some scripts might have started running. For this, we
need to synchronize the Debugger.enable call, which is something
that is left to take care of.
Bug: chromium:1229541, chromium:1133307, chromium:1300509
Change-Id: I44e9b053a7cf64cc1f477a68ce9389cd92a1d05d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3470237
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
With the upgrade to CodeMirror 6, we didn't include the autocompletion
for maps yet. This CL adds back for detection of `map.get(` which will
list all available keys on the map.
If the object is not a map, then the `evaluateExpression` will contain a
`result.exceptionDetails`, which means we gracefully ignore the result.
However, if it is map, we traverse the array and obtain all keys (which
are strings). The autocompletion will then also include the closing
paraenthesis, so that the result would become:
```js
const map = new Map([["somekey", 5], ["some other key"]]);
map.get(<auto-complete><press tab>
map.get("somekey")
```
The keys of the map are ordered based on the original appearance in the
keys array to ensure a deterministic autocompletion value.
Corresponding unit and e2e tests are written that verify the user story.
R=bmeurer@chromium.org
Bug: 1293807
Change-Id: I53dd9559e4a7e13fe4e36e934b66a693f606ec86
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3497704
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
These changes rename SameSiteCookieIssue to CookieIssue. A follow-up
CL will make the file name change. It rolls the browser_protocol.pdl
from Chromium to DevTools frontend. Removes the compatibility changes
introduced in [1].
DISABLE_THIRD_PARTY_CHECK=changes required due to renaming
[1]: https://crrev.com/c/3478766
Bug: 1254192
Change-Id: I45b86611edfa469238f7f30bf0006556e8f07fd2
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3499339
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Juba Borgohain <chromiumjuba@gmail.com>
Until now, console group titles were always shown despite filter.
Now, a console message is shown if:
- its message content matches the filter
- the title of the group (or parent group, grand-parent group, etc.
matches the filter.
If a console message is shown, then the group it belongs to
(including parent group, grand-parent group, etc.) are also shown.
Fixed: 1068788
Change-Id: I04f280b185d183bd9992b9b65ef9a9d20da0a36f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3364094
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
This change adds the "copy" context menu and "store as global variable"
menu item for console evaluations that return primitive values.
These features was previously only enabled for objects and primitive
values inside objects.
We also fix a bug where we would send an invalid CDP command when users
copied primivites inside objects.
Bug: 1208389
Change-Id: I28a85d1bcfb8325098d4d35cee7f3e83e919185c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2978352
Commit-Queue: Johan Bay <jobay@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
This is a reland of crrev.com/c/2959898 which caused the roll to fail.
This has been fixed by updating expectations in `front_end/Tests.js`
Original change's description:
> Improve Console display of strings
>
> We recently changed how we display the output to ensure that we always
> display valid JavaScript literals. Unfortunately, the current solution
> can be confusing to users, who might feel that the amount of escaping is
> excessive and makes the output unreadable.
>
> This change introduces `formatAsJSLiteral` that given a string escapes
> appropriate special characters and wraps the string in either single
> quotes, double quotes, or back ticks depending on the string content.
> The function furthermore escapes script tags to ensure that the result
> can be safely copied to HTML.
>
> Both regular Console output and preview have been updated to use this
> formatter instead of JSON.stringify for displaying strings.
>
> This change adds unit tests for the new formatter and rebaselines all
> e2e tests that depend on Console outputs.
>
> Doc: https://goo.gle/devtools-strings
> Bug: 1208389
> Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898
> Commit-Queue: Johan Bay <jobay@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
Bug: 1208389
Change-Id: I6f443e65364d9707d02aeaab0227bd691300b417
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2978351
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Johan Bay <jobay@chromium.org>
This is a reland of 9242d13569
which caused a failure on the chromeos bot. This has been fixed
in this CL by updating a test expectation in `front_end/Tests.js`
Original change's description:
> Improve Console display of strings
>
> We recently changed how we display the output to ensure that we always
> display valid JavaScript literals. Unfortunately, the current solution
> can be confusing to users, who might feel that the amount of escaping is
> excessive and makes the output unreadable.
>
> This change introduces `formatAsJSLiteral` that given a string escapes
> appropriate special characters and wraps the string in either single
> quotes, double quotes, or back ticks depending on the string content.
> The function furthermore escapes script tags to ensure that the result
> can be safely copied to HTML.
>
> Both regular Console output and preview have been updated to use this
> formatter instead of JSON.stringify for displaying strings.
>
> This change adds unit tests for the new formatter and rebaselines all
> e2e tests that depend on Console outputs.
>
> Doc: https://goo.gle/devtools-strings
> Bug: 1208389
> Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898
> Commit-Queue: Johan Bay <jobay@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
Bug: 1208389
Change-Id: I63b343c5251611f688029c5b833fb7e1f777c6cc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2974927
Commit-Queue: Johan Bay <jobay@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
This reverts commit 9242d13569.
Reason for revert: causes a failure on the chromeos bots which can be
fixed by updating an expectation file on the devtools side.
We therefore revert this CL and re-land with the expectation patched.
Original change's description:
> Improve Console display of strings
>
> We recently changed how we display the output to ensure that we always
> display valid JavaScript literals. Unfortunately, the current solution
> can be confusing to users, who might feel that the amount of escaping is
> excessive and makes the output unreadable.
>
> This change introduces `formatAsJSLiteral` that given a string escapes
> appropriate special characters and wraps the string in either single
> quotes, double quotes, or back ticks depending on the string content.
> The function furthermore escapes script tags to ensure that the result
> can be safely copied to HTML.
>
> Both regular Console output and preview have been updated to use this
> formatter instead of JSON.stringify for displaying strings.
>
> This change adds unit tests for the new formatter and rebaselines all
> e2e tests that depend on Console outputs.
>
> Doc: https://goo.gle/devtools-strings
> Bug: 1208389
> Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898
> Commit-Queue: Johan Bay <jobay@chromium.org>
> Reviewed-by: Mathias Bynens <mathias@chromium.org>
> Reviewed-by: Changhao Han <changhaohan@chromium.org>
Bug: 1208389
Change-Id: I4ab58ab724ffe8833d4a44c91da05e191d3a41bc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2974923
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
We recently changed how we display the output to ensure that we always
display valid JavaScript literals. Unfortunately, the current solution
can be confusing to users, who might feel that the amount of escaping is
excessive and makes the output unreadable.
This change introduces `formatAsJSLiteral` that given a string escapes
appropriate special characters and wraps the string in either single
quotes, double quotes, or back ticks depending on the string content.
The function furthermore escapes script tags to ensure that the result
can be safely copied to HTML.
Both regular Console output and preview have been updated to use this
formatter instead of JSON.stringify for displaying strings.
This change adds unit tests for the new formatter and rebaselines all
e2e tests that depend on Console outputs.
Doc: https://goo.gle/devtools-strings
Bug: 1208389
Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898
Commit-Queue: Johan Bay <jobay@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Reviewed-by: Changhao Han <changhaohan@chromium.org>
The preview div 'console-eager-inner-preview' is always shown,
regardless whether a REPL evaluation has completed. Waiting for
a content span does actually wait for the Runtime.evaluate preview
call to complete.
This hopefully fixes the `uniqueContextId` error we see from time
to time on the mac bot.
Bug: chromium:1192052
Change-Id: Ie23f4ba17dcbf09408b963ca651408cd98d0954c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2790862
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
Previously, we'd only try to apply source maps to the following
error names:
EvalError, ReferenceError, SyntaxError,
TypeError, RangeError, Error, URIError
This CL applies it to everything ending in Error. This is a
developer pain point, and we're landing this band-aid until
we have a way to report structured stack traces from V8.
Bug: b/173826328
Change-Id: Ie6a0465c64ab3b442ac5359517e800dcacb88cb0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2766902
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Wait for the final console evaluation to complete so that we don't
have pending evaluations when we navigate the devtools renderer.
This caused flaky errors after the context group had been destroyed.
I ran a stressor on the trybots with iterations=20 before and after
the fix.
Cq-Include-Trybots: luci.devtools-frontend.try:devtools_frontend_mac_rel
Fixed: 1134579
Change-Id: Ib5fdbc57d8aa18f6a1eb018516cc27f0cac30e00
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2537966
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
We do not want source locations which are on the ignore-list to show up
in stack traces. Ignore-listed stack frames should only be shown after
clicking a 'show more' link.
This behaviour was broken, most likely since the introduction of async
live source locations.
This CL fixes the behaviour by updating the stack traces after the
LiveLocations have been updated.
Screenshots:
(before clicking 'show more') https://i.imgur.com/Gzrv5uw.png
(after clicking 'show more') https://i.imgur.com/DVj7EJ2.png
Bug: 1183325
Change-Id: I2fea963acbed6c6f18ea2426fd3a60960158b18d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2727495
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>