Page 1 of 2

Introduce useful custom buttons for ABP to you.

PostPosted: Sun Oct 03, 2010 1:03 pm
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.

Re: introduce useful custom buttons for ABP to you.

PostPosted: Mon Oct 04, 2010 8:05 am
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 ;)

Re: introduce useful custom buttons for ABP to you.

PostPosted: Mon Oct 04, 2010 10:14 am
by maybee
thank you for your tip. I reduced the size of all the image with png.

Re: introduce useful custom buttons for ABP to you.

PostPosted: Mon Oct 04, 2010 10:28 am
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).

Re: introduce useful custom buttons for ABP to you.

PostPosted: Mon Oct 04, 2010 2:19 pm
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. :)

Re: introduce useful custom buttons for ABP to you.

PostPosted: Mon Oct 04, 2010 3:37 pm
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).

Re: introduce useful custom buttons for ABP to you.

PostPosted: Mon Oct 04, 2010 11:28 pm
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.

Re: introduce useful custom buttons for ABP to you.

PostPosted: Tue Oct 05, 2010 11:47 am
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.

Re: introduce useful custom buttons for ABP to you.

PostPosted: Tue Oct 05, 2010 12:08 pm
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);

Re: introduce useful custom buttons for ABP to you.

PostPosted: Tue Oct 05, 2010 12:27 pm
by nitrox
@Wladimir Palant: Thank you
Works Perfectly with ABP 1.3
Even works with Firegestures addon

Re: introduce useful custom buttons for ABP to you.

PostPosted: Tue Oct 05, 2010 1:14 pm
by maybee
I added the buttons to update all filter subscriptions in Adblock Plus by version to the webpage.

Re: introduce useful custom buttons for ABP to you.

PostPosted: Sat Oct 30, 2010 4:00 am
by Hubird
No longer working when using the current dev build of the element hiding helper :D

Re: introduce useful custom buttons for ABP to you.

PostPosted: Sat Oct 30, 2010 1:46 pm
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();

Re: introduce useful custom buttons for ABP to you.

PostPosted: Sat Oct 30, 2010 1:56 pm
by Hubird
Yep, that works.

Thanks...

Re: introduce useful custom buttons for ABP to you.

PostPosted: Sat Oct 30, 2010 3:53 pm
by maybee
I updated it. Now you can use it.
Select an element to hide (Element Hiding Helper 1.3rc.20101030 or higher)