Shouldn't start resource loads before a new view is created

Bug #1300884 reported by Chris Coulson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Oxide
Invalid
High
Unassigned

Bug Description

In the standard window.open() case, Chromium creates a WebContents for us, and then we dispatch WebVIew.newViewRequested and initialize the created view with the WebContents that Chromium gave us. An unfortunate side effect of this is that as soon as the WebContents is initialized and has a RenderViewHost, it unblocks pending resource loads from the already created RenderView in the renderer process. This means that if the application decides not to create a new WebView, Chromium has already started resource loads by the time we delete the new WebContents.

Reproducer:

In QML:

import QtQuick 2.0
import com.canonical.Oxide 1.0

WebView {
  url: "http://localhost/~chr1s/test.html"

  onNewViewRequested: {
    console.log("onNewViewRequested url: " + request.url + ", disposition: " + request.disposition + ", gesture: " + request.userGesture);
  }

  focus: true
  width: 200
  height: 200
}

test.html:

<html>
<body>
  <button onclick="window.open(&quot;test2.html&quot;);">Click me!</button>
</body>
</html>

Run the QML app whilst monitoring Apache's access.log, and then click on the button. You see this:

127.0.0.1 - - [01/Apr/2014:16:38:51 +0000] "GET /~chr1s/test.html HTTP/1.1" 200 440 "-" "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1908.4 Safari/537.36"
127.0.0.1 - - [01/Apr/2014:16:38:55 +0000] "GET /~chr1s/test2.html HTTP/1.1" 404 504 "http://localhost/~chr1s/test.html" "Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1908.4 Safari/537.36"

The second request shouldn't happen

Changed in oxide:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Adnane Belmadiaf (daker) wrote :

Not really sure, but i think this is part of the HTML5 prefetch/pre-render feature

Changed in oxide:
status: Triaged → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.