PDA

View Full Version : Issue with Crawler and Firefox 4



mirdreams
03-31-2011, 08:50 PM
1) CODE TITLE: Text and Image Crawler

2) AUTHOR NAME/NOTES: John Scheuer

3) DESCRIPTION:

One of my users noticed that with certain extensions or options on Firefox 4 the crawler script goes into an endless loop and crashes the browser. Here's his help thread from the Adblocker Plus help site (https://adblockplus.org/forum/viewtopic.php?f=1&t=7250):

Crawler ad Freezes Firefox 4.0 w/ ABP
by JackNaylorPE Wed Mar 30, 2011 12:54 am

Since installing Firefox 4.0 and updating my addons / plugins (adblock Plus 1.3.5 w/ "easylist" filter)I have been having a problem w/ my "home page". The problem results from visiting the site http://www.nysspe.org which is the 2nd tab on my 3 tab "home page". That's my state professional society and the other two are my national and local chapter societies. Opening Firefox for the first time results in a stone cold freeze which can only be resolved by opening Task Manager and ending the process.

Interestingly enough, I can restart Firefox and it will load, albeit with a pop up warning:

Warning: Unresponsive Script
A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue and the script will complete.

Script http://www.nysspe.org/scripts/crawler_rand_2.js:222

If I hit STOP I can move on. Hitting CONTINUE is back to non-responsiveness.

The script is a crawler type which displays ads scrolling horizontally. In Firefox 3.x, it just displayed an empty window and caused no problems / issues .... in 4.0, it makes the browser a very frustrating experience. Also, hitting the "important links" link on that page stops everything. Disable ABP and no problem.

Suggestions ?
JackNaylorPE

Posts: 1
Joined: Wed Mar 30, 2011 12:28 am
Top
Re: Crawler ad Freezes Firefox 4.0 w/ ABP
by Wladimir Palant Wed Mar 30, 2011 6:38 pm

Wow, that script is horribly broken - maybe you should inform the webmasters of this site that somebody might have disabled images (via Firefox options, Content, Load images automatically). This will already cause this script to go into an endless loop, entirely without Adblock Plus.

I suggest that you add the following filter to Adblock Plus to block this script (it doesn't seem to have any useful functions):

|http://www.nysspe.org/scripts/crawler_rand_2.js|

Any suggestions for how to fix this issue would be greatly appreciated.



4) URL TO CODE:
www.nysspe.org

jscheuer1
04-03-2011, 02:52 AM
Wow, that script is horribly broken - maybe you should inform the webmasters of this site that somebody might have disabled images (via Firefox options, Content, Load images automatically). This will already cause this script to go into an endless loop, entirely without Adblock Plus.

I suggest that you add the following filter to Adblock Plus to block this script (it doesn't seem to have any useful functions):

|http://www.nysspe.org/scripts/crawler_rand_2.js|

That's a little harsh. After stripping the content from a script it goes into an endless loop looking for it, and the script gets blamed!?

But I can see the point. I have an update that includes the below fix and some other minor improvements and will be contacting the Dynamic Drive site administrator with it shortly. It should only be a matter of time before it becomes the official version. You can fix your mod (crawler_rand_2.js) by adding this (red on the highlighted line near the beginning of its setup function):


Marq.prototype.setup = function(){
if(this.mq.setup) return;
this.mq.setup = this;
var s, cObj = this, exit = 10000;
if(this.c.style.height === 'auto')
this.c.style.height = this.m.offsetH . . .

And changing this near the end of that same setup function:


while(this.c.offsetWidth > this.w - s)
this.c.style.width = isNaN(this.cw[0])? this.w - s + 'px' : --this.cw[0] + this.cw[1];

to:


while(this.c.offsetWidth > this.w - s && --exit){
if(this.w < Math.max(1, s)){break;}
this.c.style.width = isNaN(this.cw[0])? this.w - s + 'px' : --this.cw[0] + this.cw[1];
}

jscheuer1
04-07-2011, 05:00 AM
Update:

Here's my new demo page:

http://home.comcast.net/~jscheuer1/side/thecrawl/

It fixes this ad block/disabled images thing and adds some other improvements. I've included the random feature. It's now a boolean true/false. The script determines which are the outer tags within the crawler and randomizes those.

This should become the official Dynamic Drive release version soon, perhaps this weekend. When it does, I'll post the link to it here.

mirdreams
04-13-2011, 05:26 PM
Thanks!!