Introduce useful custom buttons for ABP to you.

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey

Introduce useful custom buttons for ABP to you.

Postby maybee » Sun Oct 03, 2010 1:03 pm

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.
maybee
 
Posts: 130
Joined: Sun Jan 17, 2010 8:48 pm

Re: introduce useful custom buttons for ABP to you.

Postby Wladimir Palant » Mon Oct 04, 2010 8:05 am

@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 ;)
Wladimir Palant
ABP Developer
 
Posts: 8397
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Re: introduce useful custom buttons for ABP to you.

Postby maybee » Mon Oct 04, 2010 10:14 am

thank you for your tip. I reduced the size of all the image with png.
maybee
 
Posts: 130
Joined: Sun Jan 17, 2010 8:48 pm

Re: introduce useful custom buttons for ABP to you.

Postby Hubird » Mon Oct 04, 2010 10:28 am

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).
User avatar
Hubird
 
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia

Re: introduce useful custom buttons for ABP to you.

Postby maybee » Mon Oct 04, 2010 2:19 pm

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. :)
maybee
 
Posts: 130
Joined: Sun Jan 17, 2010 8:48 pm

Re: introduce useful custom buttons for ABP to you.

Postby Hubird » Mon Oct 04, 2010 3:37 pm

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).
User avatar
Hubird
 
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia

Re: introduce useful custom buttons for ABP to you.

Postby maybee » Mon Oct 04, 2010 11:28 pm

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.
maybee
 
Posts: 130
Joined: Sun Jan 17, 2010 8:48 pm

Re: introduce useful custom buttons for ABP to you.

Postby nitrox » Tue Oct 05, 2010 11:47 am

@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
User avatar
nitrox
 
Posts: 166
Joined: Wed Nov 18, 2009 12:57 pm
Location: ::1

Re: introduce useful custom buttons for ABP to you.

Postby Wladimir Palant » Tue Oct 05, 2010 12:08 pm

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);
Wladimir Palant
ABP Developer
 
Posts: 8397
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Re: introduce useful custom buttons for ABP to you.

Postby nitrox » Tue Oct 05, 2010 12:27 pm

@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
User avatar
nitrox
 
Posts: 166
Joined: Wed Nov 18, 2009 12:57 pm
Location: ::1

Re: introduce useful custom buttons for ABP to you.

Postby maybee » Tue Oct 05, 2010 1:14 pm

I added the buttons to update all filter subscriptions in Adblock Plus by version to the webpage.
maybee
 
Posts: 130
Joined: Sun Jan 17, 2010 8:48 pm

Re: introduce useful custom buttons for ABP to you.

Postby Hubird » Sat Oct 30, 2010 4:00 am

No longer working when using the current dev build of the element hiding helper :D
User avatar
Hubird
 
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia

Re: introduce useful custom buttons for ABP to you.

Postby Wladimir Palant » Sat Oct 30, 2010 1:46 pm

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();
Wladimir Palant
ABP Developer
 
Posts: 8397
Joined: Fri Jun 09, 2006 6:59 pm
Location: Cologne, Germany

Re: introduce useful custom buttons for ABP to you.

Postby Hubird » Sat Oct 30, 2010 1:56 pm

Yep, that works.

Thanks...
User avatar
Hubird
 
Posts: 2850
Joined: Thu Oct 26, 2006 2:59 pm
Location: Australia

Re: introduce useful custom buttons for ABP to you.

Postby maybee » Sat Oct 30, 2010 3:53 pm

I updated it. Now you can use it.
Select an element to hide (Element Hiding Helper 1.3rc.20101030 or higher)
maybee
 
Posts: 130
Joined: Sun Jan 17, 2010 8:48 pm

Next

Return to Adblock Plus for Firefox support

Who is online

Users browsing this forum: No registered users and 15 guests