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

[How-To] AdBlock for Sailfish-Browser

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

mgbler gravatar image

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

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.


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


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


edit retag flag offensive close delete



Great, it works!!!

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

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 +0300 )edit

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

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

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


J4ZZ ( 2014-02-19 05:46:01 +0300 )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 +0300 )edit

8 Answers

Sort by » oldest newest most voted

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

drcouzelis gravatar image

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

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:       localhost.localdomain localhost
::1     localhost6.localdomain6 localhost6
edit flag offensive delete publish link more


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

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

@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 +0300 )edit

that made my internet faster :)

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

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 Tahkalampi update installed at the moment.

Sandoz ( 2014-08-16 00:07:26 +0300 )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 +0300 )edit

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

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



Any idea how to make AdBlock work again? :)

Drekkarian ( 2014-05-15 15:14:11 +0300 )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 +0300 )edit

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

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

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

vasavr ( 2014-05-16 15:32:07 +0300 )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 +0300 )edit

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

jbrek gravatar image

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

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
iptables -t nat -A OUTPUT -p tcp --dport 53 -j DNAT --to-destination
edit flag offensive delete publish link more


Thank you, nice hint.

jolladiho ( 2014-08-18 12:28:56 +0300 )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 and this little trick works, browsing speeds are better as pages seem to load quicker.

Spam Hunter ( 2014-10-29 01:35:06 +0300 )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 +0300 )edit

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

ApB gravatar image

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

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


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 +0300 )edit

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

DarkTuring gravatar image

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


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



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 +0300 )edit

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

ApB gravatar image

Did it just came back with the last update :D

edit flag offensive delete publish link more



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 +0300 )edit

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

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

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

ilpianista gravatar image

You could also give a try to hostsblock

edit flag offensive delete publish link more


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 +0300 )edit

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

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



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

Seen: 13,228 times

Last updated: Nov 08 '16