[Webkit-unassigned] [Bug 29193] [chromium] Need to prevent Javascript sleeps in unload handlers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 15 18:24:01 PDT 2009


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





--- Comment #18 from Adam Barth <abarth at webkit.org>  2009-09-15 18:23:59 PDT ---
Ok.  I've read all the relevant info.  As in most things, agree with Darin. 
Some background:

1) A number of web pages are super slow to close because they are lame and chew
up a lot of time in their unload handlers in order to get some network pings to
the server for analytics.

2) These scripts are optimized to evade common browser defenses for slow
script.  For example, one ad network adds a bunch of 200ms unload event
handlers to avoid the slow script dialog.

3) John is excited about tricking these scripts by manipulating the clock, but
no one else seems excited by that plan because of the following concerns:
  a) Not all the unload scripts use Date to sleep.
  b) These checks can be worked around, creating an arms race that we cannot
win.

4) To my mind, a better approach is that proposed by Peter in
http://code.google.com/p/chromium/issues/detail?id=7823#c20 (and supported by
Linus in http://code.google.com/p/chromium/issues/detail?id=7823#c49) is to
hide tabs once the user clicks the close button.  John points out this has a
number of strange corner cases involving zombie tabs reappearing from their
hidden state.

5) The design proposed by Darin in
http://code.google.com/p/chromium/issues/detail?id=7823#c58 seems workable.  To
summarize here:
  a) Run beforeunload as normal.
  b) Before invoking unload, hide the tab.
  c) If the page attempts to alert / confirm / rise from the dead, ignore it.

I think the patch attached to this bug is a giant hack that doesn't solve the
problem.

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