Can't navigate headless with javascript |
||||
Issue description
Headless version: HeadlessChrome/61.0.3151.0
1. Run chrome headless with a remote debugging port
2. Get a new target via the /json/new command
3. Try to Runtime.evaluate the following code:
window.location = "https://google.com";
Expected: the webpage gets navigated to the google website.
Actual: the webpage doesn't navigate.
However, if the target is first navigated to any URL via the `Page.navigate` method, the subsequent call of
window.location = "https://google.com";
succeedes.
I've debugged the issue up to the FrameLoader::CheckLoadCanStart method
which fast-returns with kNavigationPolicyIgnore, checking for
frame_->GetDocument()->PageDismissalEventBeingDispatched()
As a result, the FrameLoader::StartLoad bails out early.
,
Jul 12 2017
,
Jul 17 2017
,
Jul 17 2017
Does this also happen if you use Target.createTarget instead of /json/new?
,
Aug 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4128efccf60f8de7866dbb7af683db4fcdbfa59d commit 4128efccf60f8de7866dbb7af683db4fcdbfa59d Author: Luca Versari <veluca@google.com> Date: Fri Aug 04 13:33:22 2017 headless: Implement HeadlessWebContentImpl::Delegate::OpenURLFromTab OpenURLFromTab in headless used the default implementation, that does nothing. This caused a couple of issues when the rendered asked the browser to create new content. The most clear effect of this was that setting window.location via JavaScript from the about:blank page had no effect, but it also caused issues with other renderer-initiated but browser-controlled navigations. R=eseckler@chromium.org Bug: 739969 Change-Id: I4c1080c2f41d5701b44b8c7e87d8a697c408e539 Reviewed-on: https://chromium-review.googlesource.com/600218 Reviewed-by: Eric Seckler <eseckler@chromium.org> Commit-Queue: Luca Versari <veluca@google.com> Cr-Commit-Position: refs/heads/master@{#492010} [modify] https://crrev.com/4128efccf60f8de7866dbb7af683db4fcdbfa59d/headless/lib/browser/headless_web_contents_impl.cc [modify] https://crrev.com/4128efccf60f8de7866dbb7af683db4fcdbfa59d/headless/lib/headless_web_contents_browsertest.cc [add] https://crrev.com/4128efccf60f8de7866dbb7af683db4fcdbfa59d/headless/test/data/link.html
,
Aug 4 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by pbomm...@chromium.org
, Jul 7 2017Labels: M-61