Attempting to refresh a data: URI page results in blockage |
||||||
Issue descriptionChrome Version: 62.0.3181.0 OS: Windows 10 What steps will reproduce the problem? (1) Open Chrome (2) Open DevTools via F12 console. (3) Paste data:text/html,;hi<script>document.write(Math.random());</script> in omnibox and hit enter. Observe: Page loads. (4) Hit F5 or click refresh Expect: Refresh, with a new random number shown Actual: Console notification "Not allowed to navigate top frame to data URL: data:text/html,;hi<script>document.write(Math.random());</script>" Interestingly, I can't reproduce on ToT or with 61.0.3163.39, which leads me to think that maybe this is some combination of Site Isolation and/or PlzNavigate? What happens instead? Please use labels and text to provide additional information. For graphics-related bugs, please copy/paste the contents of the about:gpu page at the end of this report.
,
Aug 10 2017
I disabled both SiteIsolation and TopDocumentIsolation. The repro seems to depend on chrome://flags/#browser-side-navigation; it repros when Enabled and does not repro when Disabled.
,
Aug 17 2017
The problem is that NavigationHandle.IsRendererInitiated() returns true for reloads. Interestingly, right-click and "Reload" doesn't have this problem. I wouldn't expect rightclick+Reload to be different than F5.
,
Aug 17 2017
,
Aug 17 2017
Re #3: I was only repro'ing with the DevTools open; do they somehow capture the F5 and re-dispatch it?
,
Aug 17 2017
Great point. They are not capturing F5, but chrome's ReloadInternal() delegates the reload to DevToolsWindow: https://cs.chromium.org/chromium/src/chrome/browser/ui/browser_commands.cc?rcl=78ab7a20a5d3a321ee8262b82970c08bf8bc894d&l=255 DevTools then calls InspectorPageAgent::reload() which calls LocalFrame::Reload() which will initiate a renderer-initiated navigation. In that case, this is a devtools bug where it causes all browser-inititated reloads to be renderer-initiated. I'm downgrading this back to P3 given that it only happens when the console is open. DevTools team, can you please take a look?
,
Aug 17 2017
Cool! So it sounds like there may be two issues then: 1. The issue raised in this bug, whereby all browser-initiated reloads are converted to renderer-initiated, and 2. Whatever scenario DevTools has for intercepting refresh isn't achieved when Right-Click>Reload is used to reload the page.
,
Aug 17 2017
Yes, the context menu is directly calling webcontent's NavigationController.Reload(): https://cs.chromium.org/chromium/src/chrome/browser/renderer_context_menu/render_view_context_menu.cc?rcl=8ea62164a55064489614aa0a038743b8419c2312&l=1794 So there is at least 4 different ways to reload a page, each doing something different :p 1. F5, Shift+F5 2. Reload button in the navigation bar (hopefully same as (1)) 3. Right click -> Reload 4. window.location.reload()
,
Dec 11 2017
,
Dec 14 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/bcd23d6f4f2986c65794188c2a0cc94e87d32b52 commit bcd23d6f4f2986c65794188c2a0cc94e87d32b52 Author: Andrey Lushnikov <lushnikov@chromium.org> Date: Thu Dec 14 19:38:03 2017 DevTools: fix reload for data URLs. This patchs starts running browser-side reload for data URLs. Note: this means that "scriptToEvaluateOnLoad" argument will be ignored when reloading data URLs. BUG= 754470 R=dgozman Change-Id: Ib0a07a4395ea2aca881958587e82d18dded81d95 Reviewed-on: https://chromium-review.googlesource.com/823702 Reviewed-by: Dmitry Gozman <dgozman@chromium.org> Commit-Queue: Andrey Lushnikov <lushnikov@chromium.org> Cr-Commit-Position: refs/heads/master@{#524144} [modify] https://crrev.com/bcd23d6f4f2986c65794188c2a0cc94e87d32b52/content/browser/devtools/protocol/page_handler.cc [add] https://crrev.com/bcd23d6f4f2986c65794188c2a0cc94e87d32b52/third_party/WebKit/LayoutTests/inspector-protocol/page/reload-dataurl-expected.txt [add] https://crrev.com/bcd23d6f4f2986c65794188c2a0cc94e87d32b52/third_party/WebKit/LayoutTests/inspector-protocol/page/reload-dataurl.js [modify] https://crrev.com/bcd23d6f4f2986c65794188c2a0cc94e87d32b52/third_party/WebKit/Source/core/inspector/browser_protocol.json [modify] https://crrev.com/bcd23d6f4f2986c65794188c2a0cc94e87d32b52/third_party/WebKit/Source/core/inspector/browser_protocol.pdl
,
Dec 14 2017
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by elawrence@chromium.org
, Aug 10 2017