Bug 65412
Summary: | beforeload event doesn't block the resource correctly: it reloads over and over | ||
---|---|---|---|
Product: | WebKit | Reporter: | famlam <fam.lam> |
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> |
Status: | UNCONFIRMED | ||
Severity: | Normal | CC: | ap, beidson, fam.lam, kling, webkitlink, zalan |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://movies.nytimes.com/2011/07/29/movies/cowboys-aliens-with-daniel-craig-review.html |
famlam
Summary:
A beforeload event is fired over and over all the time when the resource is blocked
Steps to Reproduce:
1. install AdBlock (http://safariadblock.com/ or for Chrome https://chrome.google.com/webstore/detail/gighmmpiobklfepjocnamgkkbiglidom). Disable all filter lists except for EasyList in it's options page (accessible via the button on the toolbar)
2. visit http://movies.nytimes.com/2011/07/29/movies/cowboys-aliens-with-daniel-craig-review.html
3. open the developer tools (by choosing inspect element on the page). Go to the tab 'profiles' and run a CPU profile. Notice the function 'canload' (safari.self.tab.canLoad, directly called from the beforeload event) from the source code is called over and over all the time (resulting in high CPU usage).
4. Insert a breakpoint in the injected script 'adblock_start.js' in the function beforeloadHandler (in the line 'var el = event.target'). Notice it's always the same resource (http://graphics8.nytimes.com/ads/images/misc/spacer.gif) being loaded.
Expected Results:
Blocking the resource does block the resource
Actual Results:
Blocking the resource results in the resource being reloaded
Happens in both Chrome and Safari.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
famlam
Another reproduction case:
enable the German filters of AdBlock and visit http://www.n-tv.de/
famlam
Or enable the Chinese filters and go to
http://bbs.kafan.cn/forum-25-1.html
famlam
Please note we added a workaround. After 250 times we simply allow it and continue. So the page won't hang anymore. The bug still exists however.