[Webkit-unassigned] [Bug 52581] New: preventDefault() in beforeload should prevent request

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 17 08:10:07 PST 2011


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

           Summary: preventDefault() in beforeload should prevent request
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh Intel
               URL: http://www.nearinfinity.com/blogs/jeff_kunkle/lessons_
                    learned_building_an_ht.html
        OS/Version: Mac OS X 10.6
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: kunklejr at yahoo.com


Event handlers for Webkit's beforeload event can call preventDefault() to prevent a resource from being loaded into the DOM. However, it does not prevent the resource from being requested. 

For example, if I wanted to build a text-only version of my website, I could use the beforeload event to cancel loading of all image resources. Unfortunately, Webkit will make a network request for them anyway and just not place them in the DOM for display. This behavior defeats the usefulness of "preventing" the load since bandwidth will be used to download images that will never be shown.

Another example would be an ad blocker extension. While the extension could prevent ads from being displayed, it could not speed things up by preventing them from being requested over the network. In the same vein, while the user wouldn't see the ads, they would still be tracked by the ad service since the requests are made regardless of whether preventDefault() is called.

The beforeload event is great, but it would be even more valuable if calling preventDefault() on the beforeload event would cancel the request entirely.

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