Commit Graph
59 Commits
Author SHA1 Message Date
Wolfgang Beyer 56d5ed1b5d Show document resource for iframes written to with 'document.write()'
This CL takes care of rendering a placeholder for the document resource
of an iframe which has been written to via JS's 'document.write()'.
The backend considers the document containing the 'document.write()'
call as the document of the frame being written to. Since this could
confuse users, instead of showing this document or showing no document
at all, this CL renders a placeholder "Document not available" resource,
which explains the situation to the user.

Bug: 1107766
Change-Id: Ie982b85ae89ccc8d8a95790fd1b9e002639859fb
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2643513
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2021-01-29 11:19:03 +00:00
Tim van der Lippe ba0e645b37 Fix remaining no-implicit-coercion errors in front_end/
R=jacktfranklin@chromium.org

Bug: 1082789
Change-Id: I100a53f7abd5d35565a3062769273e61c00cbafd
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2612902
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2021-01-07 14:30:46 +00:00
Kim-Anh Tran 91f0398396 Use a ResourceTreeFrame's security origin as context in console
Previously, for generated OOPIF we selected the first available url
of the Runtime.CallFrame as a context in the console for context
selection. This change uses the security origin of the
ResourceTreeFrame instead.

We believe that the call frame url was only used because the
security origin could have been stale after programmatic updates
of frames via document.write. Since such updates are now accounted
for after the fix in https://crbug.com/1140481, we can rely
on the security origin to be correct.

The developer expectation for the subtitle is to see the origin of
the frame, and this CL is a step towards this goal.

Bug: chromium:1159332, chromium:1132260
Change-Id: I54d690075f6767f54da60c1dc203d00e6760b83f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2593135
Commit-Queue: Kim-Anh Tran <kimanh@chromium.org>
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-12-16 11:26:15 +00:00
Wolfgang Beyer f928006cb6 Update frame tree when frames are written to via JS
Even though writing to a frame's document via JS is not considered a
navigation by the backend, it can change the information DevTools is
showing about a frame in the frame tree. We are adding a new CDP event
'Page.documentOpen' in the backend, which in the frontend triggers
the same cascade a frame navigation would. This ensures that
ResourceTreeFrame and therefore the frame tree is kept up to date.

Design Doc:
http://docs/document/d/1l-XzjFMdASjRzX4-vMxOoK-MXoxY5uhCe0GNfDsXeDo
Backend CL: https://crrev.com/c/2498482

DISABLE_THIRD_PARTY_CHECK=depedency

Bug: chromium:1140540, chromium:1140481
Change-Id: Ieb72c3ef0830aff19964310b1728d218d6da9943
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2519702
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-12-07 15:19:01 +00:00
Wolfgang Beyer a36129e3ea Update protocol to handle new CDP event
Updates protocol including dispatchers to handle newly added
`Page.documentOpen` CDP event.

Backend CL: https://crrev.com/c/2498482

Bug: chromium:1140540, chromium:1140481

DISABLE_THIRD_PARTY_CHECK=protocol update

Change-Id: Idf75e9101508923f83abb2525116611b4e2ff7a9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2507793
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-11-13 08:59:33 +00:00
Sigurd Schneider eabef9611d Show API availability in FrameDetailsView
This CL shows the gated APIs/features for SAB, SAB+postMessage and
document.domain in the FrameDetailsView. The CL also introduces
a deprecation warning if SAB+postMessage is currently available,
but the context is not cross-origin isolated.

DISABLE_THIRD_PARTY_CHECK=required for dependency

Screenshots: https://imgur.com/a/7UJ2JpZ
Bug: chromium:1139899
Change-Id: Id4c892b9a9842cbf655d40debc315cd24b7cf978
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2514443
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2020-11-05 11:57:01 +00:00
Tim van der Lippe 3c7eedcd60 Remove all definitions of usesObjectNotation
This was a temporary method, used during the migration to use
objects in dispatcher callbacks. Since all dispatchers now receive
the event as an object, we can remove these temporary methods.

R=aerotwist@chromium.org

Fixed: 1138492
Bug: 1011811
Change-Id: Ib7fbfae567ebc9b2be0a5d760458e5b0c7edc12e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2484723
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-10-20 10:59:51 +00:00
Sigurd Schneider 5a5b735963 Improve template types in Target/SDKModel
The Target.model method's type can be improved to convey the type of
the result (based on the constructor argument). This CL does just that.
This unlocks more checking down the line. The CL also alters the types
of the observeModel(s) methods, but in a weaker way, as closure is
apparently not able to instantiate the template correctly for method
invocations.

Bug: chromium:1011811
Change-Id: Ic466cfd946c30f3fcfb4ce24a8a0e1bc542e7d3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2445776
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-10-05 12:21:48 +00:00
Adithya Srinivasan a535569300 Portals: Add support for highlighting in ConsoleContextSelector
This CL adds support for higlighting a portal element when the entry for
its execution context in the console context selector is hovered over.
It also fixed the same behaviour for OOPIFs.

Bug: 1005916
Change-Id: I5fdc283cdb789cd897244aee9007cf4ee926ce1a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2418795
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
2020-09-21 13:18:30 +00:00
Adithya Srinivasan 98da489dc0 Portals: Fix isTopFrame logic
A portal has its own frame tree that is not connected to its owner
element's frame tree. This resulted in isTopFrame returning true for a
portal's main frame, despite it not being the top-most frame in the
inspected tab.

Change-Id: I789d25c2a194ae866b9fadd9338c018a18efd898
Bug: 1127046
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2404384
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Commit-Queue: Adithya Srinivasan <adithyas@chromium.org>
2020-09-15 13:16:52 +00:00
Sigurd Schneider b8e8ad564d [ts] Type-check sdk/ResourceTreeModel.js with TypeScript
R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Id3157b05955191741b50aefe7583d6c189aea8c4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367942
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-08-26 15:23:13 +00:00
Tim van der Lippe 662c01bba2 Remove ProtocolProxyApiWorkaround
The upstream issue has been fixed in TypeScript 4 and therefore this workaround
is no longer necessary.

R=sigurds@chromium.org

Change-Id: I4a831566f3a7f7756f8938668c38e5fabe2ca14c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2367947
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-08-21 14:10:19 +00:00
Sigurd Schneider aef2982079 Surface more info about security and isolation
Screenshot: https://imgur.com/a/ylTqUYO
Bug: chromium:1051466
Change-Id: I800de6256937b7eb32ea87113e07b36164d81a32
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2364596
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2020-08-20 14:38:04 +00:00
Simon Zünd c5d9d48d50 [issues] Add detection for third-party SameSite cookie issues
This CL implements 'isCausedByThirdParty' detection for SameSite
cookie issues. Issues we consider caused by a third-party are not
shown by default but can be enabled via a Issues tab setting.

We assume developers have no control over third-party sites,
making reported issues non-actionable.

For SameSite cookies, we compare the cookieUrl with the top-most
frames registered domain. In the future, we want to compare the
cookieUrl with the top-most frames first-party set, which should
be almost a perfect fit.

Drive-by: Mirror newly added CDP field 'domainAndRegistry' on
ResourceTreeFrame.

R=chlily@chromium.org, sigurds@chromium.org

Bug: chromium:1080589
Change-Id: I70ce06aa7c50aee87219b2c24acc2c2a9c806e6c
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2339523
Reviewed-by: Lily Chen <chlily@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-08-11 04:55:10 +00:00
Sigurd Schneider d5dec09c44 Generate COEP issues based on issues generated in the back-end
This also undoes a change where certain frame navigations are
ignored in the front-end to improve debuggability. The reason is
that the change doesn't work for OOPIFs, and as those are very
common with COEP issues, prevents debugability there. We likely
need to adopt a fix similar to https://crrev.com/c/2144163 to
solve this issue.

Screenshot: https://imgur.com/a/zfeMiHl
Bug: chromium:1051466, chromium:1078823
Change-Id: I943ba9a38909b6f4505d24bdd89263f9e58cf730
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2332229
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-08-03 14:57:27 +00:00
Sigurd Schneider f1aba72454 Add ad status to frame details in application panel
This builds on the back-end CL https://crrev.com/c/2289850,
which adds some basic reporting of the ad status of a frame.
We expect to improve the reporting such that the cause for
a frame being tagged as an ad can be debugged, but we will
do this incrementally.

Screenshot: https://imgur.com/a/pm4khn8
Bug: chromium:1095617
Change-Id: I74597c94ca9b6ece4646e0e551d45950462bec2a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2306152
Reviewed-by: Eric Robinson <ericrobinson@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: John Delaney <johnidel@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-07-24 07:16:59 +00:00
Sigurd Schneider 1e5ad28c80 Link to related panels from the frame details view
The frame details view shows basic information about frames. This CL
adds links to the Elements, Sources, and Network panels.

Screenshot: https://imgur.com/a/ZlCAMjE
Bug: chromium:1093247
Change-Id: Iee0ef5af541681f16d19fc139c04b4b6ad425d91
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2300114
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Auto-Submit: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
2020-07-17 14:56:54 +00:00
Wolfgang Beyer 12a57e80b3 Clearly distinguish between parent and cross target parent for frames
ResourceTreeModel and ResourceTreeFrame contain the concepts of parent
frame and cross-target parent frame. A frame can only have one of the
2. With this CL parentFrame() means either one, otherwise
sameTargetParentFrame or crossTargetParentFrame are used to specify
which one is meant.

Bug: chromium:1093247
Change-Id: Ide6929c9cc3b92edc0310ebd38340169a07cc43e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2288703
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2020-07-10 12:33:59 +00:00
Wolfgang Beyer e304158eb9 Fix highlighting of frames for frame tree
This CL fixes the highlighting of frames when hovering over them in
the application panel's frame tree. Previously, this behaviour was not
working for OOPIFs (out of process iframes).

Bug: chromium:1093247, chromium:1101768

Change-Id: I782d511d6765538f2bc15fd4f52445df73119584
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2277984
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
2020-07-03 13:30:19 +00:00
Sigurd Schneider 904129daf3 [browser_sdk] Refactor main frame navigated event listening
This CL introduces a TopFrameNavigated event on the FrameManager.
Unfortunately, this event is not useful to front_end/sdk, as our
layering currently forbids importing browser_sdk there.

However, other places in devtools may use this event to listen
for navigations on the main frame.

Note that in contexts are related to the state of V8, the right
event to listen to might be executionContextDestroyed or even
executionContextsCleared.

Bug: chromium:1069378
Change-Id: Ib56d51c9a0d27346ef91e81029d49ae4c2c66fff
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2270167
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
2020-06-26 13:21:16 +00:00
Sigurd Schneider e82fe5da5c [issues] Link frame resource to rest of devtools
This introduces the machinery to link from the issues panel to the
elements panel for frame resources. It also introduces highlighting
of the frame when the frame URL in an Heavy Ads issue is hovered.

Screenshot: https://imgur.com/a/J6dHD97
Bug: chromium:1095617
Change-Id: I165fefafdbca02ad1a00e3b79e7d6b83c572ece8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2260675
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Simon Zünd <szuend@chromium.org>
2020-06-24 11:46:29 +00:00
Jan Scheffler cb29d3aed1 Keep frames blocked by the heavy ads intervention
This cl will prevent the navigation from an ad that
has been blocked due to heavy ad intervention to it's
error interstitial from appearing in DevTools.
This allows developers to still inspect resources from
those adds.

Fixed: chromium:1078822
Change-Id: I90a1f08680f40eae38cdf52ac27df301fb1ac995
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2213427
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Peter Marshall <petermarshall@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-28 12:48:00 +00:00
Jan Scheffler aa0100504b Enable TypeScript in ScreenCaptureModel
This patch also adds empty Dispatcher interfaces to TypeScript
that are compatible with closure to unblock the TypeScript work.

Bug: chromium:1011811, chromium:1079233, chromium:1081686
Change-Id: I9487f8c5b51098267ede176fc18171923c757442
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2196383
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-26 15:55:34 +00:00
Andrey Kosyakov 8ad44a779e Ignore getResourceTree responses with invalid URLs
Test is downstream: https://crrev.com/c/chromium/src/+/2200430

Bug: 1078135, 1081270
Change-Id: I4381429951f301f9461947568d4539bcd783fc56
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2200666
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-14 10:15:54 +00:00
Tim van der Lippe c1b68e2514 Emit fixes for TypeScript 3.9.2
These fixes are required to fix the declaration files emitted
with TypeScript 3.9.2

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: If7c29221d31c228b0d0bbbd2949168de0f68444d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199079
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-05-14 10:10:34 +00:00
Tim van der Lippe 86e3a6a5ad Add missing return types for function parameters in sdk/
These are required for the upcoming TypeScript 3.9.2 upgrade.

R=jacktfranklin@chromium.org

Bug: 1011811
Change-Id: I6e9d568ea8a9c7482d355a7d8bc084a579a0202e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2199120
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-05-13 11:31:01 +00:00
Simon Zünd f2c41c6649 Restore old behavior in ResourceTreeModel
The CL https://crrev.com/c/1934208 caused failed CDP messages to not
resolve its Promise with null, but instead propagate the exception
via "reject". This caused the ResourceTreeModel not to properly
intialize and, cascading down, the ConsoleModel to swallow messages.

This CL fixes this by adding a catch handler that calls
{_processCachedResources} with null, thus, restoring the old behavior.

R=changhaohan@chromium.org

Bug: chromium:1063012
Change-Id: I16da2cf2a77e22493e671a01ef1dfed222b2f1d9
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2162742
Reviewed-by: Changhao Han <changhaohan@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-04-27 04:35:25 +00:00
Wolfgang Beyer 209a6444a2 Update protocol
This rolls recent inspector issue changes from chromium to
devtools.

DISABLE_THIRD_PARTY_CHECK=roll protocol changes

Change-Id: Iee4c3095bb44c3875f6ac6810d79e7ccf6f67d9a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2160941
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
2020-04-23 11:47:50 +00:00
Tim van der Lippe dc9d2515c5 Add @ts-nocheck annotations to sdk and typecheck sdk/Connections.js
To enable full parallelization of all files in sdk/, we can add the
@ts-nocheck annotation to all files. This suppresses existing
TypeScript errors in these files.

We can then one-by-one remove these annotations and fix the issues
reported in these files. This allows us to parallelize the work
and work on many files at the same time.

As a starter, I typechecked sdk/Connections.js to verify that
typechecking works while all other files are not checked yet.
I did do so by locally suppressing all TypeScript errors in
SDKModel.js and remove the `instance` method on `TargetManager`.
I then confirmed that rebuilding with TypeScript correctly
fails on the missing method, but does not require SDKModel.js
itself to be typechecked.

Bug: 1011811
Change-Id: I46de3839f7d837e951967dd932218bda00c6ad5b
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2156352
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-04-22 13:17:59 +00:00
Jan Scheffler 6e711c3775 Show cookies for unreachable frames
This cl fixes the regression introduced in crrev.com/c/2035930 by
removing the changes and instead showing cookies for the unreachableUrl
in Application > Cookies too.

Bug: chromium:1047348, chromium:1057948, chromium:1066415
Change-Id: Ie25bc4df6f5e432debef1958ef7d27c09a44b183
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2144163
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-04-16 11:11:19 +00:00
Simon Zünd 182134236e Rename namespace import for protocol_client to ProtocolClient
R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Idf3e9eb8f6d52db78f563de53b7576ec6c9b9cdc
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107557
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-19 12:08:52 +00:00
Simon Zünd 3b0c540211 Rename front_end/protocol to front_end/protocol_client
This CL is part of the work to switch over to the TypeScript compiler
for type checking.

R=tvanderlippe@chromium.org

Bug: chromium:1011811
Change-Id: Ic709a193b252df7e9027c00cf20d8afe525a215a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2107539
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-18 18:06:20 +00:00
Simon Zünd 43de24b42b [utilities] Use Set instead of Array in ResourceTreeModel
This CL changes ResourceTreeModel._childFrames to be a Set instead
an Array. This is part of a cleanup effort to get rid of Array#remove.

Bug: chromium:1050549
Change-Id: I8718dc149ec9fe75fa38dddefe59625a5d63eb26
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095311
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Simon Zünd <szuend@chromium.org>
2020-03-10 11:23:03 +00:00
Paul Lewis daac106699 [global] Remaps self.SDK.targetManager
This CL changes references to self.SDK.targetManager (the global
instance of SDK.SDKModel.TargetManager) over to
SDK.SDKModel.TargetManager.instance(). To keep both TypeScript and
Closure happy we must make a method on the TargetManager class itself,
since it only allows private constructors to be accessed by static
methods on the class.

Bug: 1058320
Change-Id: I6ca35024c21cf24254fd6273138a1ab3e163ee00
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2088092
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-03-05 14:58:03 +00:00
Jan Scheffler d4c73c6d70 Ignore navigations to chrome-error frames
This cl drops navigations to chrome-error frames
in order to allow developers to debug the original
page.

Bug: chromium:1047348
Change-Id: I6079805cbd9805ad42c3e16a2510eb921b9ba3f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2035930
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
Reviewed-by: Mathias Bynens <mathias@chromium.org>
2020-02-17 16:12:26 +00:00
Tim van der Lippe c02a97ca2c Fix imports for Common.Event typedef
All references now use the fully qualified
"Common.EventTarget.EventTargetEvent". It renames it to
"EventTargetEvent" to prevent a name-clash with the native "Event" type.

Bug: 1006759
Change-Id: I13fcdfd613041da146d741a0d1f785bfc905a7a8
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2056481
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +00:00
Tim van der Lippe 5ed0fb968c Fix internal bindings in sdk/
These were some left-over fixes that regressed while doing phase 3 of
ESM. It includes fixing the typedefs in sdk-legacy to be in the proper
file and exported.

Bug: 1006759
Change-Id: I939d4287a78888fba65d4baed04ee90f14c88e23
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2055065
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-02-14 15:21:06 +00:00
Simon Zünd a0d40624e1 [utilities] Replace {valuesArray} with {values} and/or spread operator
For {Set}s we omit the call to Set#values, since spreading a set
{foo} "[...foo]" is equivalent to "[...foo.values()]".

Drive-by: Remove the now unused Map#valuesArray and Set#valuesArray.

Bug: chromium:1050549
Change-Id: Ic9b51f957d895265a79a7fa3471ecb6cb734a1f0
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2050770
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-02-12 16:45:22 +00:00
Mandy Chen b7a76b287a Update frontend to process installabilityErrors
Follow-up CL to the Page.getInstallabilityErrors CDP method change [1].

In the frontend, process installabilityErrors instead and localize the
error messages.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2008430


Bug: 946860
Change-Id: I9f2441f106fff9758edc401c624652179f451e3f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016235
Reviewed-by: Lorne Mitchell <lomitch@microsoft.com>
Commit-Queue: Mandy Chen <mandy.chen@microsoft.com>
2020-01-27 23:27:00 +00:00
Tim van der Lippe d41d863344 Migrate sdk/ to import cross-module
Bug: 1006759
Change-Id: I1f4d365ca078007f9d5e5b005e748bac3993e8da
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2016757
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-01-23 16:10:20 +00:00
Paul Lewis 4ae5f4f5ce [Global] Update refs to SDK.targetManager
Bug: 1006759
Change-Id: I0686ef929b89e75c2ea8a731c593d955eca85935
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2015119
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>
2020-01-23 10:56:40 +00:00
Tim van der Lippe 9293af7230 Migrate sdk/ to ESM internally
Bug: 1006759
Change-Id: I2bb0c8eaa4fdc89edd8da2b12d9fd0e08d427174
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2003327
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
2020-01-17 15:17:17 +00:00
Jan Scheffler 3c387a84cd Show manifest as used by the browser
This cl surfaces the actual manifest icons used by the
browser as there might be some preprocessing like for
example cropping going on.


Fixed: chromium:985402
Screenshot: https://imgur.com/a/ivmidtj
Change-Id: I0c3093b2fd7f82ab029e91c835985eab77bd2ee4
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1936208
Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
2019-12-16 14:30:31 +00:00
Tim van der Lippe 20b29c2646 Enforce newlines at end of files
Trying to upload a CL with missing newlines at the end of files fails with the following warning:

These files should end in one (and only one) newline character:

Update the ESLint config to let the linter fix these errors.

Change-Id: Ia858b5864a1dc43144e0c6d81dedbf46376c2b8d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1897679
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
2019-11-04 15:02:44 +00:00
Tim van der Lippe 9b7d21d126 Migrate sdk/ to ESM
Bug: 1006759
Change-Id: I3f5917ab3f5b3fb823ca460c395301ba19eed2df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1841792
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#703381}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5a7c8d13f806d781e8edb96a9b1f152d4fe1258a
2019-10-07 18:48:07 +00:00
Tim van der Lippe 1d6e57a0e3 Always add braces to single-line if-statements
The Chromium/Google style guides does not enforce curly braces for
single-line if-statements, but does strongly recommend doing so. Adding
braces will improve code readability, by visually separating code
blocks. This will also prevent issues where accidental additions are
pushed to the "else"-clause instead of in the if-block.

This CL also updates the presubmit `eslint` to run the fix with the
correct configuration. It will now fix all issues it can fix.

Change-Id: I4b616f21a99393f168dec743c0bcbdc7f5db04a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1821526
Commit-Queue: Tim Van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Reviewed-by: Jeff Fisher <jeffish@microsoft.com>
Cr-Original-Commit-Position: refs/heads/master@{#701070}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 7e0bdbe2d7f9fc2386bfaefda3cc29c66ccc18f9
2019-09-30 11:55:34 +00:00
Tim van der Lippe ffa7862d4e Update Closure compiler to v20190729
The new compiler caught a lot of pre-existing issues in the codebase.
Sadly, the old compiler version was not smart enough to understand the
new changes. Therefore, the changes have be included in the same CL as
the compiler update.

Most of the changes are related to better handling of prototype and
class inheritance, as well as handling of null/undefined tracking.

Change-Id: I3941a3a240a4d09c4945e1e20d2521090ef837c9
Bug: 991710
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762081
Reviewed-by: Yang Guo <yangguo@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@google.com>
Auto-Submit: Tim van der Lippe <tvanderlippe@google.com>
Cr-Original-Commit-Position: refs/heads/master@{#696761}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ca93474213278e32e36d6ace1474c56884030757
2019-09-16 12:07:12 +00:00
Andrey Lushnikov f42bffc0b7 DevTools: intercept file chooser requests
One of the big issues of web automation is handling file uploads.
Many uploads are created "on the fly" without touching page's DOM:

  const e = document.createElement('input');
  e.type = 'file';
  e.click();

As a result, the |DOM.setFileInputFiles| method is not applicable since
clients can't get a reference to |e|.

This patch suggests an alternative approach to intercept file chooser
dialogs.

With file chooser interception, protocol clients:
- enable file chooser interception with |page.setInterceptFileChooserDialog| command
- subscribe to the |page.fileChooserOpened| event
- handle file choosers with |page.handleFileChooser| command

The implementation resides in the //content layer to handle both //chrome
and //headless embedders.

NOTE: With file chooser interception enabled, the
native "file chooser" UI is not shown since the control belongs to
DevTools.

For the record: this is a re-upload of https://crrev.com/c/1661775

Change-Id: Ibbc8826845c94818a6cb03c8b59ae95237478286
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1679638
Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#673121}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 81b992e76d7268d78f51ee955c1d952c5d23de0f
2019-06-27 23:27:21 +00:00
Andrey Kosyakov ffd1ef9ead DevTools: add Page.downloadWillBegin event to track downloads
Bug: b/131183141
Change-Id: I4db5d99a42220319e98871903ec94c28e25cd628
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1582623
Reviewed-by: Min Qin <qinmin@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Andrey Kosyakov <caseq@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#654563}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0bb8a01fb35b38d60e010c1db9c23cd63197e5e1
2019-04-26 19:36:05 +00:00
Pavel Feldman 0c1a96a0b8 DevTools: introduce Page.getInstallabilityErrors based on InstallableManager.
... and migrate front-end to it.

Bug: 915945
Change-Id: I91220f7d7681fef3faa4c543b729d3475df5b8ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1560533
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: Joel Einbinder <einbinder@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#649761}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c9465362c786f8342fd11ee5a56ae1641b26b600
2019-04-11 03:02:17 +00:00