PDA

View Full Version : Ad blocking no questions asked


LewistonianExonian
2006-09-13, 04:12 PM
I used the 5.5 betas for about the length of a trial period and ended up coming back to safari. I miss site preferences, its speed advatage, the lightweight look, tab thumbnails (Stand does nothing but annoy me...) everything. except ad blocking. I know everyone is like "it works fine, you just need..." and on the list are a perfect blocklist, because if one thing isn't a regex OW can understand the whole thing goes down the tubes. Also there is custom CSS and other things I have heard. Why can't this just be simpler, like everything else in this app seems to be. Why can't I just put the filterset.g text file in line by line (As I spent time doing) and expect it to work? I keep my ow5 prefs file, and I will be trying out new OW releases until omniweb's ad blocking, like everything else on my mac Just WorksTM. Once it does, I will be delighted to switch back.

Forrest
2006-09-13, 04:37 PM
I just check Matching known ad sizes, From third-party sites and From blocked URLs. Then I adjust the site prefs or hit command+shift+i as needed. Sometimes I right-click and hit Filter image.

I might mess with the blacklist, manually, once a month.

zottel
2006-09-24, 11:38 AM
A little late, I know—just came back from a vacation. :-)

How is that filterset.g file formatted? With the usual glob patterns, i.e. "*" stands for "zero or more 'anychars'", "?" stands for "exactly one 'anychar'"?

If the file only contains URLs, line by line, you just have to replace "*" by ".*", "?" by ".", and "." by "\.".

As I don't have to work for another week, I would write a simple perl script that does the changes if anyone is interested. You could then just copy&paste the lines of the resulting file.

WebJIVE
2006-10-02, 06:01 AM
A little late, I know—just came back from a vacation. :-)

How is that filterset.g file formatted? With the usual glob patterns, i.e. "*" stands for "zero or more 'anychars'", "?" stands for "exactly one 'anychar'"?

If the file only contains URLs, line by line, you just have to replace "*" by ".*", "?" by ".", and "." by "\.".

As I don't have to work for another week, I would write a simple perl script that does the changes if anyone is interested. You could then just copy&paste the lines of the resulting file.

I would be very interested in that script!! That's the one thing about FF I love, Fiterset.G

Attach it here if possible and I will provide feedback.

Thanks!

zottel
2006-10-05, 12:30 PM
Where can I get a filterset.g file to see how it is formatted?

WebJIVE
2006-11-02, 05:12 PM
here: http://www.pierceive.com/filtersetg/

zottel
2006-11-03, 12:59 PM
Hm, the host seems to be down atm. I'll see into this soon when I can get sth from there. :-)

jcraig
2006-11-07, 06:28 PM
Rick's Easyfilter is the cream of the crop when it comes to Adblock filter subscriptions. You can find it here:

http://easylist.adblockplus.org/adblock_rick752.txt

gray49
2006-11-07, 11:56 PM
Hello,
Could someone please tell me how to import
the adblocking filters into omniweb...
Alas...I have tried and failed.
Thanks in advance for any help.
Peace
Stuart

zottel
2006-11-12, 08:36 AM
I still couldn't connect to the pierceive host, so I used the link jcraig posted. So here is a small perl script (link at the bottom of this post) that will translate this file into usable regular expressions with some small caveats:

– "$" seems to have a special meaning in the patterns used for Adblock Plus. I don't know what meaning this is, though, so I left these lines out. If you see a blank line in the output of glob2re.pl, it means that the script encountered a line containing a "$" and thus coudn't provide a translation.

– "?" isn't used with the meaning it normally has in glob patterns, but as a literal "?". glob2re.pl will match this behaviour instead of doing the translation "normal" glob patterns would need. So if you want to translate anything else than files for Adblock Plus, some lines might not work.

– The lines below "! WHITELIST---" are for the whitelist, obviously. Don't enter this line and the "!" at the end of the whitelist as ad blocking lines in OW. Just leave them out. Enter the lines after "! WHITELIST---" in the lower box of the ad blocking settings in OW.

– Don't enter the lines at the beginning of the file, the one that contains "[Adblock Plus" and the ones starting with a "!" directly below.

To use the script, download the file at the bottom of this post and put it into some directory where you will find it again. ;-) Open the Terminal and type

cd <yourdirectory>

where <yourdirectory> is the directory you put glob2re.pl in. If you don't know where it actually is, you can open the parent directory of <yourdirectory> in the finder, type "cd " in the terminal (note the space after cd) and then drag&drop <yourdirectory> from the finder to the terminal and hit enter.

Now you have to make glob2re.pl executable. To do this, type:

chmod 0755 glob2re.pl

Now it's ready to use. Whenever you want to use it, first cd to <yourdirectory> as shown above.

glob2re.pl uses a parameter you give to it as a file name to read the glob patterns from. If you don't give it a parameter, it will read from stdin. This means it waits for you to type in or paste glob patterns and will then translate those to regular expressions. It will do so until you press Ctrl-d. If you want to have your output in a file, just add "> yourfile.txt" at the end of the command line.

Examples:

To enter or paste glob patterns in the terminal and directly see the results, enter:

./glob2re.pl

It will then wait for input until you press Ctrl-d.

The same, but don't see the results, instead collect them in the file "filter.txt":

./glob2re.pl > filter.txt

Read the file adfilter.txt (which resides in <yourdirectory>) and see the output in the terminal:

./glob2re.pl adfilter.txt

Read the the file thisfilter.txt on your desktop and put the results into the file filter.txt:

./glob2re.pl ~/Desktop/thisfilter.txt > filter.txt

The lines glob2re.pl spits out can directly be used as lines for ad blocking in OmniWeb.

Note: If you download and translate a filter file that is formatted for windows, you might see "^M" at the end of each line of the output of glob2re.pl, depending on what viewer you use to view the results. Don't try to enter those "^M"s in OmniWeb, just leave them out.

Here is the link to the script. Right- or Ctrl-click on the link and choose "Save link as ...".

http://mac.zottel.net/glob2re.pl

(Note: This link resides on my home mac via a dialup line. I'm normally online 24h/day, but if you happen to try it just at the moment a 24h-reconnect occurs, it might not work. Just try again a few minutes later.)

Note: This is just a small hack. No guarantee whatsoever, use at your own risk. No license, just redistribute and/or reuse as much as you want. ;-)

Len Case
2006-11-15, 12:30 AM
I would like to mention that we have made several improvements to the white/blacklist in 5.5.2 (not yet released).


we will highlight in red any regular expressions that are not correctly written.
incorrect expressions will be skipped instead of disabling the whole list.
copy and paste will now work in a reasonable manner
copying several items will copy them as plain text, one regex per line
pasting text will split each line into a separate regex
you will be able to select more than 1 item for copy or delete.

Omnius
2006-11-24, 11:06 AM
i perfectly understand that Omni relies on itself even though there might be useable and useful solutions out there, created by 3rd party devs.
that's why i don't present my suggestion here uncommented.
as much as i am looking forward to an inhouse solution of Omni for this feature, add blocking for me is no issue any longer.

i'm using BFilter (see the ad blocking thread on this forum: http://forums.omnigroup.com/showthread.php?t=2032).
the latest version of it is fast and eliminates all annoying ads without the risk of accidentally launching a hidden link by clicking on it

BFilter info:

http://www.macupdate.com/info.php/id/20181