Firefox hangs with large ABE rule

Post a reply

Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :arrow: :| :mrgreen: :geek: :ugeek:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Firefox hangs with large ABE rule

Re: Firefox hangs with large ABE rule

by Thrawn » Wed Feb 26, 2014 10:01 am

The addon page claims it's based on EasyList. I believe it's not quite as comprehensive, though. Speed is the key.

One possible 'best of both worlds' approach is mentioned here.

Re: Firefox hangs with large ABE rule

by access2godzilla » Wed Feb 26, 2014 8:07 am

Thrawn wrote:Someone has beaten you to the idea.
You see, I'm not running to the patent office with that fifty line Perl script; and the main logic is the contribution of a person from stackoverflow, so even if I were to try to do so my hopes are dashed.

I'll have to see from where exactly they get their list, though.

Re: Firefox hangs with large ABE rule

by Thrawn » Tue Feb 25, 2014 10:29 pm

Someone has beaten you to the idea.

Re: Firefox hangs with large ABE rule

by access2godzilla » Tue Feb 25, 2014 11:55 am

I made the necessary modifications to the above script (and consequently the generated rule also changed); I've edited the pastebin content to reflect this. Thanks for the pointers, Giorgio.

I'm quite satisfied with the results; seems like I can use this as a lightweight ad-blocking tool on some of my older computers which poorly perform with ABP.

Re: Firefox hangs with large ABE rule

by Giorgio Maone » Tue Feb 25, 2014 11:22 am

ABE recognizes as regular expressions clause arguments starting with "^", so just prepend a "^" character to your optimized expression.

Re: Firefox hangs with large ABE rule

by access2godzilla » Tue Feb 25, 2014 10:51 am

I wrote a "converter" based on Giorgio's hints (thanks!). However, Noscript doesn't seem satisfied with the regex and gives an error: "line 2:6 no viable alternative at character '?'".

The converter: http://pastebin.com/2upXX3yd
The generated rule, run on hpHosts ATS: http://pastebin.com/9LFHJ266

What could be the problem now? Something in my code? Something in the Regexp::Assemble module?

Re: Firefox hangs with large ABE rule

by Giorgio Maone » Wed Feb 19, 2014 11:49 am

Each "Site ..." uses an AddressMatcher object which in turn gets compiled to a rather unoptimized regular expression, unless, of course, it's recognized itself as a single regular expression literal: you can force this recognition by starting the expression with the "^" character.
Therefore, the best way to "import" an external list as an ABE rule is making your import script transform it into one single, possibly optimized regular expression and feeding it to a single "Site ..." clause.

Re: Firefox hangs with large ABE rule

by Thrawn » Wed Feb 19, 2014 10:34 am

Pastebin is reporting that that paste has been removed?

I wouldn't suggest using ABE as an ad/malware blocker this way. You might be able to, but there are much better tools for the job, like ABP.

But if the size of the ABE messages in the console is the issue, you could simply try splitting it into multiple rules.

Firefox hangs with large ABE rule

by access2godzilla » Wed Feb 19, 2014 7:52 am

I have a rather large ABE rule generated from the hpHosts ATS list. However, it seems that with large ABE rules, Firefox's hangs whenever I try to open the error console, and I have to terminate Firefox manually.

What changes needed to the ABE rule so that the problem does not occur?

Top