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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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
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
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