Introduce useful custom buttons for ABP to you.

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey
maybee
Posts: 130
Joined: Sun Jan 17, 2010 7:48 pm
Contact:

Introduce useful custom buttons for ABP to you.

Post by maybee »

Let me introduce useful custom buttons for ABP to you.
these are toolbar buttons for Adblock Plus and require Custom Buttons extension.

the buttons are
  1. Open blockable items
  2. Select an element to hide
  3. Preferences + Update all subscriptions
  4. Disable everywhere (Adblock Plus 1.3.5a2.2826 or higher) New
  5. Disable everywhere + Reload this page (Adblock Plus 1.3.5a2.2826 or higher) New
  6. Update all subscriptions
and they are all toggle buttons.
there are the links for installing buttons on following site : http://maybeefilter.tistory.com/114
After installing Custom Buttons extension You just click on the CB's link for adding any buttons you want to do.
Screenshot :
Image

you can change their icons and tooltip and name of buttons.
these buttons might be useful to use Adblock Plus efficiently.

* note :
Wladimir Palant wrote:"Disable everywhere" is only the new name for "Enable Adblock Plus". The code above will work both with Adblock Plus 1.3.3 and Adblock Plus 1.3.5.
Last edited by maybee on Fri Oct 14, 2011 12:19 pm, edited 7 times in total.
Wladimir Palant

Re: introduce useful custom buttons for ABP to you.

Post by Wladimir Palant »

@maybe: I recommend using pngout to minimize the size of PNG images. The ABP icon in your "Enable Adblock Plus" button is more than 3 kB - after pngout it is only 268 bytes ;)
maybee
Posts: 130
Joined: Sun Jan 17, 2010 7:48 pm
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by maybee »

thank you for your tip. I reduced the size of all the image with png.
User avatar
Hubird
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by Hubird »

Thanks for that, it should save me a few mouse clicks :D

I don't see much point for the "Enable ABP" button though (the existing button is superior as it's icon changes to reflect the state of ABP).
maybee
Posts: 130
Joined: Sun Jan 17, 2010 7:48 pm
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by maybee »

Hubird wrote:Thanks for that, it should save me a few mouse clicks :D

I don't see much point for the "Enable ABP" button though (the existing button is superior as it's icon changes to reflect the state of ABP).
you're welcome~
I want the "Enable ABP" button to be a multiplayer. but its function might be limited.
I often have used the button with simple function whenever any pages cause false positives.
that is I could know if the issuse is caused by ABP with ease. :)
User avatar
Hubird
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by Hubird »

What I meant was if you click the middle mouse button (push the wheel in) on the ABP icon it will enable or disable it for you. This is just as easy as the new button and the icon changes colour (but all the others buttons are useful :D).
maybee
Posts: 130
Joined: Sun Jan 17, 2010 7:48 pm
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by maybee »

Hubird wrote:What I meant was if you click the middle mouse button (push the wheel in) on the ABP icon it will enable or disable it for you. This is just as easy as the new button and the icon changes colour (but all the others buttons are useful :D).
I understand it. thank you for a tip, Hubird.
there is another way. using fireguesture extension you can specify its actions by mouse gesture. you can use the code which the 4 custom button use in the extension as well.
User avatar
nitrox
Posts: 166
Joined: Wed Nov 18, 2009 11:57 am
Location: ::1
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by nitrox »

@maybee: Thank you for the buttons.
Is it possible to have just update all subscriptions and i don't want to open the preferences dialog.

I tried editing the code by myself to see if i can just get update all subscriptions and disable open preferences dialog but i cant get it to work.
Fanboy list Co-Maintainer

Fanboy Adblock List's

Fanboy List Forum
Wladimir Palant

Re: introduce useful custom buttons for ABP to you.

Post by Wladimir Palant »

Before somebody comes up with even more interesting hacks, here is the code to update all filter subscriptions in Adblock Plus 1.3:

Code: Select all

var abpURL = Components.classes["@adblockplus.org/abp/private;1"].getService(Components.interfaces.nsIURI);
var modules = {};
Components.utils.import(abpURL.spec + "Synchronizer.jsm", modules);
Components.utils.import(abpURL.spec + "FilterStorage.jsm", modules);
Components.utils.import(abpURL.spec + "SubscriptionClasses.jsm", modules);
for each (var subscription in modules.FilterStorage.subscriptions)
  if (subscription instanceof modules.DownloadableSubscription)
    modules.Synchronizer.execute(subscription, true, true);
In Adblock Plus 1.2.2 it should be something like this (not tested):

Code: Select all

var abp = Components.classes["@mozilla.org/adblockplus;1"].createInstance().wrappedJSObject;
for each (var subscription in abp.filterStorage.subscriptions)
  if (subscription instanceof abp.DownloadableSubscription)
    abp.synchronizer.execute(subscription, true, true);
User avatar
nitrox
Posts: 166
Joined: Wed Nov 18, 2009 11:57 am
Location: ::1
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by nitrox »

@Wladimir Palant: Thank you
Works Perfectly with ABP 1.3
Even works with Firegestures addon
Fanboy list Co-Maintainer

Fanboy Adblock List's

Fanboy List Forum
maybee
Posts: 130
Joined: Sun Jan 17, 2010 7:48 pm
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by maybee »

I added the buttons to update all filter subscriptions in Adblock Plus by version to the webpage.
User avatar
Hubird
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by Hubird »

No longer working when using the current dev build of the element hiding helper :D
Wladimir Palant

Re: introduce useful custom buttons for ABP to you.

Post by Wladimir Palant »

Of course not - EHH architecture changed similarly to Adblock Plus :)

This should work for the new version:

Code: Select all

document.getElementById("ehh-command-selectelement").doCommand();
User avatar
Hubird
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by Hubird »

Yep, that works.

Thanks...
maybee
Posts: 130
Joined: Sun Jan 17, 2010 7:48 pm
Contact:

Re: introduce useful custom buttons for ABP to you.

Post by maybee »

I updated it. Now you can use it.
Select an element to hide (Element Hiding Helper 1.3rc.20101030 or higher)
Post Reply