[webkit-dev] out of control javascript

Rob Burns robburns1 at mac.com
Sat May 10 06:14:34 PDT 2008


I'm contemplating filing one or more bugs on an issue I'm facing with  
out of control javascripts (not my javascripts, but others). This  
might be something better solved by Safari and other applications  
using WebKit, but I'm wondering whether there's any possible solutions  
at the Webkit level.

First some background information I've been traveling with a MacBook  
Air. My primary browser is Safari. Usually I maintain many open  
windows and each with many tabs. However, battery life is precious on  
the MacBook Air since there's no way to change batteries. However I  
find that if I leave my javascript and plugins enabled in Safari that  
there are one or more javascripts that inevitably eat up my battery  
and within a very short time. My work around has been to turn off  
javascript and plugins and launch Firefox whenever I need those (the  
same problem exists with Firefox and I find that if I forget to quit  
Firefox when I'm done with the javascript browsing my Air gets very  
hot and the processors are pegged in Activity Monitor.)

So my question is that are these simply poorly written plugins and  
poorly written javascripts? Is there any way for WebKit to keep these  
somehow in check (loading a YouTube video and leaving it running in a  
background tab or window is an especially egregious consumer of  
processor cycles).

If not at the WebKit level, I'm considering filing one or more Safari  
bugs at ADC. For example, would it create any problems to have  
javscripts paused on all documents loaded in all tabs but the  
frontmost (that way a user could even load an empty tab in a window  
just to avoid run-away processes). Even for audio only processes, It  
doesn't strike me as an undue burden for audio processes to cease in  
buried tabs. I know this isn't the place to discuss Safari  
specifically, but there's got to be a way to get these processes under  
control with either WebKit of the applications using WebKit.

The other option I can see is some sort of evangelism to encourage web  
content creators (and plugin makers) to utilize event driven models  
with javscript (I haven't looked at the javascripts in depth, but my  
guess is that they're cycling and polling continuously to heat up my  
cpu so much).

Take care,

More information about the webkit-dev mailing list