We have moved to a new Sailfish OS Forum. Please start new discussions there.
156

[How-To] AdBlock for Sailfish-Browser

asked 2014-02-19 00:25:17 +0200

mgbler gravatar image

updated 2016-11-08 04:42:56 +0200

DarkTuring gravatar image

Edit 2:

For the time being try the solutions by @drcouzelis (edit hosts file) or ny @jbrek (use alternative DNS). The images were removed for better readability.

Edit:

With the current version of Sailfish-Browser (mozembedlite) I didn't find a way to install AdBlock. Yet. If I or someone else finds a method it we be published here. Thx


Ahoi,

today I'm sharing how you can get rid of ads and (some) malware/tracking while using our beloved standard browser. I assume you all know AdBlock, if not search it on https://duckduckgo.com/?q=adblock

  1. Go on https://addons.mozilla.org and search adblock
  2. Choose AdBlock Plus, then long press the install button and choose open in new tab
  3. swipe to accept and install
  4. Go to chrome://adblockplus/content/ui/subscriptionSelection.xul and choose your subscription
  5. Go to about:addons, tap AdBlock Plus->Preferences->Filter Rules and uncheck the allowance of addon-promoted ads
  6. Profit

By the way check out chrome://adblockplus/content/ui/ there you'll find all addon specific dialogues like firstRun.html. However you can't simply tap on the link but have to type the filename like this: chrome://adblockplus/content/ui/firstRun.html

cheers

edit retag flag offensive close delete

Comments

2

Great, it works!!!

deedend ( 2014-02-19 00:59:44 +0200 )edit
10

Does it work for Ghostery or Disconnect too? Adblocking is one thing, but actually I'm more interested in stopping trackers, which happen to include most ads; Ghostery therefor makes a great adblocker as well.

Fuzzillogic ( 2014-02-19 01:20:27 +0200 )edit

Has anyone tried ad-block edge with built in browser? https://bitbucket.org/adstomper/adblockedge

Tanghus ( 2014-02-19 02:46:16 +0200 )edit
9

Adblockedge is installing fine. Go to: https://addons.mozilla.org/de/firefox/addon/adblock-edge/ Install and then configure here: chrome://adblockedge/content/ui/subscriptionSelection.xul

Regards,

J4ZZ ( 2014-02-19 05:46:01 +0200 )edit

Great post! Thanks a lot! I can't believe I didn't think of trying this before :)

Drekkarian ( 2014-02-19 14:12:40 +0200 )edit

8 Answers

Sort by » oldest newest most voted
30

answered 2014-08-13 19:47:43 +0200

drcouzelis gravatar image

updated 2014-08-14 19:52:33 +0200

I setup ad blocking by modifying the "/etc/hosts" file (similarly to the comment by @garrosh).

Installation: This needs to be done as root (use the "su-devel" command).

1) Make a backup of the original file:

mv /etc/hosts /etc/hosts.ORIGINAL

2) Get the latest copy of of the hosts file with blocked advertisers and save it as "/etc/hosts". In one command:

curl http://winhelp2002.mvps.org/hosts.txt -o /etc/hosts

That's it! No reboot necessary.

Result: System-wide ad blocking, including all web browsers and applications, with no slowdown to the device.

Note: If you have any special entries in your hosts file then you will need to combine your original hosts file with the new ad blocking version of the file. If you don't know what I'm talking about then you can ignore this.

Uninstalling: Just put the original file back:

mv /etc/hosts.ORIGINAL /etc/hosts

If you don't have the original "/etc/hosts" file, here are the contents for reference:

127.0.0.1       localhost.localdomain localhost
::1     localhost6.localdomain6 localhost6
edit flag offensive delete publish link more

Comments

@drcouzelis Could you pls elaborate a little bit about how to combine the two files correctly?:)

Alex ( 2014-08-14 12:47:31 +0200 )edit
1

@Alex I added more detailed instructions to my original post. The new file has all the information that the original file needs, so it's ok to simply replace it.

drcouzelis ( 2014-08-14 19:34:55 +0200 )edit
1

that made my internet faster :)

mgbler ( 2014-08-15 13:51:49 +0200 )edit
2

First of all thank you for this advice, but at least in my case this does not block most ads. It blocks some ads in desktop versions but not in mobile version of sites. Also it leaves a "blank"-spot instead of ads, so it's not quite as useful as AdBlock.

Edit: I forgot to mention: I have 1.0.8.19 Tahkalampi update installed at the moment.

Sandoz ( 2014-08-16 00:07:26 +0200 )edit

@Sandoz - That's true, there are benefits and drawbacks. Which website has ads that it didn't block? Did you report them? They won't get blocked if nobody reports them. ;)

drcouzelis ( 2014-08-16 03:00:16 +0200 )edit
9

answered 2014-05-15 14:03:32 +0200

Quattra gravatar image

This doesn't work with current build of Sailfish. Any idea how to revert changes that Adblock made?

edit flag offensive delete publish link more

Comments

1

Any idea how to make AdBlock work again? :)

Drekkarian ( 2014-05-15 15:14:11 +0200 )edit

i want it too. Maybe we have to wait for the new update, maybe it comes with the new version of the browser (real tabs), maybe than we can activate a adblocker (of course... real tabs have no sense ;) )

cvp ( 2014-05-15 19:07:46 +0200 )edit
1

To revert, the simplest method is to delete /home/nemo/.mozilla That will reset everything :)

mgbler ( 2014-05-16 09:41:45 +0200 )edit

In another question someone posted that the latest development version of Adblock Edge works

vasavr ( 2014-05-16 15:32:07 +0200 )edit

When I try to download and install Adblock Edge, it's say that "It's not available for Maemo" 😢

carmenfdezb ( 2014-05-16 18:05:47 +0200 )edit
9

answered 2014-08-15 13:27:28 +0200

jbrek gravatar image

updated 2014-08-15 13:30:28 +0200

My solution to block ads (android & sailfish apps, browser, ...) is to redirect dns requests to FoolDNS with iptables:

iptables -t nat -A OUTPUT -p udp --dport 53 -j DNAT --to-destination 87.118.110.215
iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination 87.118.110.215
edit flag offensive delete publish link more

Comments

Thank you, nice hint.

jolladiho ( 2014-08-18 12:28:56 +0200 )edit

Thank you, works a treat!

Should this not be selected as the right answer, as the question was how to Ad'Block' for Sailfish-Browser.

I'm using Sailfish 1.1.0.39 and this little trick works, browsing speeds are better as pages seem to load quicker.

Spam Hunter ( 2014-10-29 01:35:06 +0200 )edit

stupid question but how do you create the ip table and are any programs required other than terminal and a.txt editor?

DarkTuring ( 2016-09-22 02:20:47 +0200 )edit
1

answered 2016-02-23 23:25:14 +0200

ApB gravatar image

updated 2016-02-23 23:25:54 +0200

How can someone remove the Adblock plus plugin? Obviously about:addons doesn't zoom to disable/remove it from there so it has to be done manually.

And BTW has anyone tested uBlock Origin?

edit flag offensive delete publish link more

Comments

you have to delete it manually from your profile folder. Search under /home/nemo/.mozilla for the addon folder or simply remove the whole .mozilla folder. Start the Terminal App an enter rm -rf /home/nemo/.mozilla .

mgbler ( 2016-02-24 09:05:17 +0200 )edit
1

answered 2016-11-08 04:56:25 +0200

DarkTuring gravatar image

Even easier and i would say more thoroughly blocking is through proxy:

http://www.speedmeup.net/setup

For the sailfish browser in About:config in address line you can search for the proxy settings and add the speedmeup proxy directly so that all browser communication always gets routed there.

Works like a charm for me, super fast, faster then host files since they can get large and it takes more time to DNS filter.

edit flag offensive delete publish link more

Comments

3

Even in the best scenario, this (fortunately) won't work for https-sites. You'd still give up quite a bit of privacy, as requests to ad-servers and trackers still might contain a good amount of identifying data. You'll probably leak referrer headers all over, providing a nice trail of the actual websites you're visiting.

I won't trust some third party with my entire browsing.

Fuzzillogic ( 2016-11-09 00:11:25 +0200 )edit
0

answered 2014-06-09 23:13:47 +0200

ApB gravatar image

Did it just came back with the last update :D

edit flag offensive delete publish link more

Comments

1

I solved this adblocking issue in a slightly different way. Back in the days of android I used to use an app called adaway. That app replaced the system wide hosts file (/etc/hosts) with a huge hosts file where all sorts of ad-serving sites are re-routed to localhost... I linked the aliendalvik hosts file to the sailfishos hosts file, so now I've got ad blocking in both "android" and sailfish :-D Works like a charm.

garrosh ( 2014-06-11 10:35:50 +0200 )edit

Too bad hosts file blocking isnt a solution good enough for my needs.

vasavr ( 2014-06-11 22:15:53 +0200 )edit
0

answered 2014-09-12 01:19:01 +0200

ilpianista gravatar image

You could also give a try to hostsblock

edit flag offensive delete publish link more

Comments

Something hosts related should be made into an app. At least untill Adblock plus can be used with the main browser -mine still works-. Don't know if harbor will allow it but even openrepos is a good solution.

ApB ( 2014-09-12 01:36:56 +0200 )edit
0

answered 2014-11-15 22:02:46 +0200

piloti gravatar image

Hi... Mostly works. Step 5 fails as the browser won't load or zoom to allow me to find the AdBlock to choose the final setting, but apart from that, works. Less adds, faster browsing. Great, thanks.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
59 followers

Stats

Asked: 2014-02-19 00:25:17 +0200

Seen: 13,793 times

Last updated: Nov 08 '16