个人工具

UbuntuHelp:UbuntuLTSP/AdblockPlusGlobalInstall

来自Ubuntu中文

跳转至: 导航, 搜索
This page is specific to Ubuntu versions 8.04

If you find this information applicable to additional versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions. This page is dedicated to installing Adblock+ in firefox for ALL users of a system. This is incredibly useful for environments such as schools where users might experience 'roaming mouse' syndrome...you know, clicking on "FREE iPOD!!!1" banners and the like. This installation will install Adblock Plus for every user of an LTSP system or shared server so that everyone uses the same patterns file and it is fairly transparent to the user.

Procedure

First off, you're going to want to create a specific directories for Firefox to hold the Adblock Plus add-on:

sudo mkdir /usr/lib/firefox-addons/extensions/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}
cd /usr/lib/firefox-addons/extensions/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}

Now we're going to download the Adblock Plus add-on directly from their website. NOTE: Please update the links whenever a new version of Adblock comes out!

sudo wget --no-check-certificate https://addons.mozilla.org/downloads/latest/1865/adblock_plus-1.1.xpi

Now we unzip the add-on:

sudo unzip adblock_plus-1.1-fx+sm+tb.xpi

Now you want to start up Firefox and subscribe to a list. I live in the US, so I use Easylist USA. Please download the appropriate list for your locale/preference. Once you have subscribed, close Firefox and let's make some directories and move the patterns file so everyone can access it. NOTE: You can edit the shared path to your liking, this is just the one I use.

sudo mkdir -p /home/share/firefox/adblockplus

sudo mv ~/.mozilla/firefox/<YourProfileDir>/adblockplus/patterns.ini /home/share/firefox/adblockplus/

sudo chmod 644 /home/share/firefox/adblockplus/patterns.ini

Finally, we're going to want to edit the global Adblock+ configuration so it points to the global patterns.ini file, and if you want, to make the add-on fairly transparent to the user (out of sight, out of mind):

sudo vim /usr/lib/firefox-addons/extensions/{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}/defaults/preferences/adblockplus.js

adblockplus.js:

  • extensions.adblockplus.showintoolbar (set to false)
  • extensions.adblockplus.patternsfile (set to /home/share/firefox/adblockplus/patterns.ini)

That should about do it! Enjoy an ad-less web browsing experience for all! :)

Links

http://adblockplus.org/en/faq_install#global