Sorry, excuse me luk3Z for posting a macro that I did not test with 74 official but only with naruman's 74+1 where it definitely works.
You will need help from some one that knows more than me.
p.s. Maybe use naruman's version of the official if You need the icon.
http://kmeleonbrowser.org/forum/read.php?2,128038
Else download the old adblock addon from
http://kmext.sourceforge.net/ext1.htm
adblockplus1.0.2.7z contains a macro with an icon. It should still work.
BTW. To use the most recent version of adblock You need to edit the Firfox version number in install.rdf. Or use an addon that suppresses compatibility checking even further.
https://addons.mozilla.org/firefox/addon/checkcompatibility/
Quote
siria
Sorry guenter, but I tried your long macro in KM1.6, and not even there it is showing a button (with a dummy bmp used)
Now that would be normal without the plugin installed, except that your macro does not put the plugin command in the toolbar, but a MACRO command, which would be shown anyway.
And the macro command it assigns to this button is named "abDisable" - which isn't defined anywhere in that kmm.
Perhaps in a second kmm, but then, this one also tries to sync the button state of the "Popups" button, inside the ABP-Toolbar, which makes no sense at all.
Now my guess is: THIS macro is not what makes your own ABP work, but something else, whatever it is. Would be curious what happens if you disable it? If then your button still shows and works?
Or perhaps it still works and I just don't understand it, who knows.
Anyway, without that unknown working part of ABP I don't know the correct names of its true commands.
But here's a dummy test anyway, just to see if button-creation works, nothing else.
The command names and right-click menu are exchangeable with the correct names, if anyone knows them.
For this dummy test I just used the Pref-calling macro from the lone setmenu line in the short-version macro above, hoping that function really exists:
#----------- save as adblockplus_showbutton.kmm
# adblockplus-PLUGIN must be installed or this doesn't work
adblockplus_showbutton{
# Toolbar name can be a new, independant one, or an existing one to add it there (e.g. "&Main Bar")
$_toolbar= "Adblock Plus TEST" ;
$_size="16,16";
$_icons="adblockplus.bmp[0],adblockplus.bmp[0]" ;
$_command = "adblockplus(Preferences)" ;
$_right_menu="Adblock Plus";
$_tooltip= "(test) Adblockplus Prefs";
$_buttonname="AdblockPlusTEST";
# SYNTAX: pluginmsg(toolbars, "AddButton", "<ToolbarName>, <ButtonName>, <Command>, <MenuName>, <TooltipText>, <ButtonWidth>, <ButtonHeight>, hot.bmp[0], cold.bmp[0], dead.bmp[0]");
# Next line creates a new toolbar, but is simply ignored if name already exists, so no harm:
pluginmsg(toolbars,"AddToolbar",$_toolbar.",".$_size);
pluginmsg(toolbars,"AddButton",$_toolbar.",".$_buttonname.",".$_command.",".$_right_menu.",".$_tooltip.",".$_size.",".$_icons);
#
$_toolbar=""; $_icons=""; $_size=""; $_right_menu=""; $_buttonname=""; $_tooltip=""; $_command="";
#
###-------------- Create MENU in Tools:
### setmenu(Misc, command, "Ad&block Plus...", "adblockplus(Preferences)");
}
$OnSetup=$OnSetup."adblockplus_showbutton;";
$macroModules=$macroModules."adblockplus_showbutton;";
Yes siria You are right. It is the macro from naruman's version. I allready found that naruman has a load.kmm in the xpi and an alteration in adblock's chrome.manifest. But to add them was not sufficient.
So luk3Z will need help from someone that knows more than me.
# Name load.kmm by naruman resides in adblock's xpi
$adblockplus_enabled="extensions.adblockplus.enabled";
$adblockplus_FlashJava="extensions.adblockplus.frameobjects";
$adblockplus_placeholders="extensions.adblockplus.fastcollapse";
$adblockplus_Count="extensions.adblockplus.savestats";
$adblockplus_EditSite="extensions.adblockplus.EditSite";
$adblockplus_BlockItem="extensions.adblockplus.Blockitem";
$adblockplus_BlockitemType="extensions.adblockplus.BlockitemType";
adblockplusFilters{
$OpenURL="chrome://adblockplus/content/ui/filters.xul";
&OpenURL_InNewWindow;
}
adblockplusItems{
setpref(STRING,$adblockplus_EditSite, $URL);
open("about:adblockplus");
}
abDisable{
menuchecked=getpref(BOOL,$adblockplus_enabled);
togglepref(BOOL,$adblockplus_enabled);
$abstatusbar=sub("%s",getpref(BOOL,$adblockplus_enabled)?"disabled":"enabled","adblock plus %s");
statusbar($abstatusbar);
}
adOptionsFlashJava{
menuchecked=getpref(BOOL,$adblockplus_FlashJava);
togglepref(BOOL,$adblockplus_FlashJava);
}
adOptionsplaceholders{
menuchecked=getpref(BOOL,$adblockplus_placeholders);
togglepref(BOOL,$adblockplus_placeholders);
}
adOptionsCount{
menuchecked=getpref(BOOL,$adblockplus_Count);
togglepref(BOOL,$adblockplus_Count);
}
adblockplus_image{
menugrayed=(hostname($URL)=="");
setpref(STRING,$adblockplus_BlockItem, $ImageURL);
setpref(STRING,$adblockplus_BlockitemType, "image");
$OpenURL="chrome://adblockplus/content/ui/KMcomposer.xul";
&OpenURL_InNewWindow;
}
setmenu("&Tools",popup,"Adblock Plus",6);
setmenu("Adblock Plus",macro,"Enable everywhere",abDisable);
setmenu("Adblock Plus",macro,"Filter preferences",adblockplusFilters);
setmenu("Adblock Plus",separator,-1);
setmenu("Adblock Plus",macro,"Live Block items on this page",adblockplusItems);
setmenu("Adblock Plus",separator,-1);
setmenu("Adblock Plus",popup,"Options",6);
setmenu("Options",macro,"Show tabs on Flash and Java",adOptionsFlashJava);
setmenu("Options",separator,-1);
setmenu("Options",macro, "Show placeholders of blocked elements",adOptionsplaceholders);
setmenu("Options",separator,-1);
setmenu("Options",macro,"Count filter hits",adOptionsCount);
#setmenu(ImageProperties,macro,"Adblock Image",adblockplus_image);
Edited 1 time(s). Last edit at 02/15/2015 04:51PM by guenter.