Skip to content

Instantly share code, notes, and snippets.

@abphowto
Last active September 11, 2018 16:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save abphowto/b31658955f5194d561ea to your computer and use it in GitHub Desktop.
Save abphowto/b31658955f5194d561ea to your computer and use it in GitHub Desktop.
System-wide installation of Adblock Plus for Mozilla Firefox

Installing Adblock Plus for Firefox as an administrator

This document describes how to manually install Adblock Plus for Mozilla Firefox on [Microsoft Windows] (http://www.microsoft.com/en-us/windows).

Downloading the XPI file

Firefox extensions are packaged as cross-platform install (XPInstall) files. These are basically regular ZIP archives using the *.xpi file extension.

Download Adblock Plus XPI

To download the Adblock Plus for Firefox XPI, go to https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/, right-click the Add to Firefox button, select Save Link As and select a save destination.

Determining the installation directory

The installation target path is defined by the following pattern:

%firefox%\browser\extensions\{d10d0bf8-f5b5-c8b4-a8b2-2b9879e08c5d}

The %firefox% stanza is to be replaced with the path of the browser's installation directory, e.g. C:\Program Files\Mozilla Firefox or C:\Program Files (x86)\Mozilla Firefox.

Extracting the extension archive

The actual installation is performed by extracting the archive from Step 1 into the target directory determined in Step 2. Refer to the illustrated step-by-step instructions below for the manual process:

Right click XPI Confirm re-naming to ZIP

After renaming the extension archive from *.xpi to *.zip, the contents can be accessed and the context menu's Extract All... option allows for easy extraction into the target directory:

Right click ZIP Select target directory Confirm directory creation Confirm extraction

Disabling user confirmation

Although you may consider the installation complete by now, Firefox will ask for confirmation to enable the extension when the browser is started. This behavior can be prevented during the configuration by following these steps:

  1. Ensure that the %firefox%\browser\default\preferences directory is present. Note: you may need to create it first.
  2. Place the following one-liner in a *.js file there:
pref("extensions.autoDisableScopes", 0);

The base name of the new file is not important here:

Silent extension installation

Note, however, that this approach is not considered optimal. See Mike Kaply's blog for a discussion of this topic.

Disabling the first-run page

Starting with the Adblock Plus development build 2.6.9.3935, and the upcoming 2.6.10 release, the first-run page can be disabled.

To do this, set the extensions.adblockplus.preconfigured.suppress_first_run_page pref to true. Please see Mozilla's documentation on how to preconfigure prefs in Firefox.

@Equanox
Copy link

Equanox commented Aug 20, 2015

I was dealing with ABP auto installation on Ubuntu 14.04 firefox. See this Stackoverflow Post including my shell script. I stumbled over this gist right now and have to mention that i wasn't able to make Point 4. work on my System. I tried to put the cmd

pref("extensions.autoDisableScopes", 0);

into

/usr/lib/firefox/defaults/pref

Ok this gist is about windows... but you may have a clou for me?

Thanks!

@mjhennig
Copy link

/usr/lib/firefox/defaults/pref should be a directory, and the code snippet should be in a file like e.g. /usr/lib/firefox/defaults/pref/snippet.js, including the .js suffix.

@bmkaiser
Copy link

bmkaiser commented May 3, 2016

Is there a recommended way to update the patterns.ini file with our preferred domain white listing and additional rule subscriptions? I know that I can just copy a version of the patterns.ini file to the user profiles, but I don't necessarily overwrite any custom rules that the end user may have set.

@Atavic
Copy link

Atavic commented Sep 11, 2018

Haozip extracts xpi files just like zip ones, no need to change file type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment