[Webkit-unassigned] [Bug 66474] New: Dynamically injected base tag from external script causes extra requests

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 18 09:41:39 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=66474

           Summary: Dynamically injected base tag from external script
                    causes extra requests
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
               URL: http://jsbin.com/umulij/8
        OS/Version: Mac OS X 10.7
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: scott at filamentgroup.com


When referencing an external script that dynamically injects a base tag with a new base href, the browser downloads subsequent assets twice each: once with a path that respects the base href, then again with a path that does not. This problem is only true in externally-referenced scripts; inline scripts work as expected, causing one request that is routed through the base href.

Steps to reproduce:

1. open http://jsbin.com/umulij/8 in Chrome (currently running version 13.0.782.112)
2. Inspect the resources panel and notice two requests to the image referenced in the body

Note that the image references are not real, so the 404s are expected.

You can view the source for this demo here:
http://jsbin.com/umulij/8/edit

The  referenced JavaScript file simply creates a base element with a faux href and injects it as a first child of the head element:
http://filamentgroup.com/examples/rwdtemp/test.js

Note that when this same script is inline in the head of the document, only one request is made. This is the intended behavior.
http://jsbin.com/ucunip/5 (source can be viewed here: http://jsbin.com/ucunip/5/edit )

As an aside, this bug now also exists in Firefox 6. Previously, this was not the behavior in either browser.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list