One feature still missing from WebPositive is an ad-blocker. Although there are a few caveats and it isn’t exactly straight forward, there is a way to avoid ads. It uses a “hosts” file that redirects traffic from known ad-servers.
Get an ad-blocking hosts file, e.g. Steven Black’s. You may want to update that one regularly.
Copy the hosts file to /system/settings/network/.
If WebPositive keeps stalling for long periods, you can intercept the redirected traffic by starting PoorMan (just go with its default settings) before starting WebPositive.
For some reason, some sites don’t like being ad-blocked in this way. Those just never load in WebPositive and leave the page empty. To get them loading, you have to quit WebPositive, rename the hosts file, and restart WebPositive. I can live with that, because I don’t frequent many sites having this problem often.
To make it easier, I created a script “Hosts-are-ON” and put it on the Desktop:
# toggle ad-blocking hosts file
if [ -e hosts ] ; then
mv hosts hosts_off
mv ~/Desktop/Hosts-are-ON ~/Desktop/Hosts-are-OFF
mv hosts_off hosts
mv ~/Desktop/Hosts-are-OFF ~/Desktop/Hosts-are-ON
Now a simple double-click on the script renames the hosts file and by renaming the script itself, shows if ad-blocking is turned on or off.
Definitely only a stop-gap solution until WebPositive learns to ad-block itself, and not suited for everyone, but I thought I post about it anyway.
The way those “filters” work is by saying the IP of the ad servers is your own machine, so the system sends the requests to your machine instead of to the real servers. Now, if your own machine does not have a web server running, those requests get stuck until a time limit to wait for a response is reached.
Interesting. So different behavior than Windows in that regards at least.
If this is case does Haiku wait too long for a response? I would think that is something that could be altered, because it should know if a certain port is open or not (thinking in netstat terms at least).
Maybe the Haiku/Web+ behaviour has changed since I wrote that, but back then the delay without a webserver catching those redirects were quite drastic, IIRC.
I’ve been auto-launching Poorman ever since. I copied the Poorman binary and set its flags to “Background app” with the FileType addon, to avoid it clogging the Deskbar…
I think what changed was Stevenblacks’s host list. They no longer designate a “valid” adress like 127.0.0.1 but now use 0.0.0.0, which is unrouteable and should fail immidiently. This is all Afaik anyhow.
Thank you for the tip about poorman, I’ll keep that it mind.
I’m using hblock, but I modified the number of sites that it makes it’s list from, as I found it seemed to bog down WebPositive. StevenBlacks was one of the one’s that I cut. I’ll have to try adding it again, and see what it does.
As an added side bonus, on a fresh install of a development build, using hblock stopped WebPositve from crashing while trying to view the NFL scoreboard on nbcsports.com. I’ve had problems with WebPositve crashing when viewing some sites, so this helps a lot.
Yes, it is that simple. You want to keep the header (eg this section) however, as it is required for the system to work correctly, so just put your customization after this section.
You probably should just copy the entries from the StevensBlacks list after the
Offtopic, but how do I send a PM to a user? I discovered Haiku a few weeks ago, and wanted to start translating. I connected my Github to i18n.kacperkasper.pl and need a mod to auth me. This interface is very confusing for me, can’t find the right buttons.
Alternatively you can just click on the link select all the text and copy and paste it to a new text file in Haiku.
right click on desktop =>new=>text file
and save this textfile as hosts.
Paste this textfile (hosts) to: boot/system/settings/network/
If there is already a hosts file you can add/apply/append the text you just copied to it. Read the above articles from extrowerk for how to do this.