General :  K-Meleon Forum
General discussion about K-Meleon. 
Clear Flash Cookies toolbar button?
Posted by: simpler
Date: January 24, 2011 09:28PM

How might I go about adding a button to the toolbar for this?

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: Matt
Date: January 25, 2011 02:38AM

Here you go. Unzip in k-meleon root folder.

Go to View > Toolbars to hide/display the toolbar button.


PS Attach file feature is gone? sad smiley

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: simpler
Date: January 28, 2011 06:51AM

Awesome. Thanks, Matt.

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: Mtestlab
Date: June 09, 2011 12:21AM

Hello all,

K-Meleon 1.5.4

I downloaded clearflashcookies.7z and installed with extensions manager.

When I use the menu command:
Tools->privacy->clear data->Clear flash cookies
All works fine

or

I Create a shortcut on desktop:
C:\Program Files\K-Meleon\tools\flashclean.exe
All works fine

However I use the privacy toolbar:
view->toolbars-Privacy Bar
And have a button with the trash can icon and "Flash"
Unfortunately, clicking this button does not clear the flash cookies.
(all other "standard buttons work fine).
Is there a tweak I can apply to remedy this?

Thanks!!!

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: hrs
Date: June 09, 2011 01:11AM

Tools > Privacy > Block Flash is something completely different than Tools->privacy->clear data->Clear flash cookies

Block Flash toggles the Flashblock extension which replaces Flash objects with a button F2 > Page Display > Content Filters

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: siria
Date: June 09, 2011 01:58AM

Actually, in my current skin and in Klassic that default button is called "KILL Flash", and that is yet another thing ;-) This doesn't toggle any setting, but it STOPS and kills already running flash stuff.

To configure any buttons, click on
Edit > Configuration > Toolbars

Use Ctrl+F to jump to the Kill Flash button.

It's not as complicated as it looks at first, really. An explanation is contained. And this code stuff gives you extreme freedom for customization!

So now you have all possibilities, depending on what you want to do?

E.g. copy and modify that whole button, to have 2 flash buttons: "Kill Flash" + "Clear flash cookies".

Or copy that button, hide the original version with comment signs # and modify the second button to use instead of "Kill" the "clearflash" macro command (don't know the exact name of it, the file has expired for download, but just open the macro file yourself (...flash...kmm) and look at the SETMENU lines at the end. Find the "setmenu....,"Clear Flash cookies",???,..." line and ??? is the command name you need. Use this for your button.

Or you could keep the normal Kill-Flash button as it is, and just add the Clear-menu to it as right-click context menu:
macros(JS_killFlash)|&Clear Data
This shows the menu to "Clear cache", "Clear Cookies", "Clear Passwords", ... etc. if you right-click on the Flash button.
Adding this menu does not require you to figure out any macro command names, so that slightly complicated italic stuff above is not needed.

Personally I prefer to have the
"Kill" menu as right-click on the Kill-Flash-button:
macros(JS_killFlash)|_Privacy_Kill
and to have the
"Clear" menu as right-click on the clear-cache-button
privacy(ClearCache)|&Clear Data
smiling smiley



Edited 2 time(s). Last edit at 06/09/2011 02:09AM by siria.

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: Mtestlab
Date: June 09, 2011 10:15PM

Quote
hrs
Tools > Privacy > Block Flash is something completely different than Tools->privacy->clear data->Clear flash cookies

Block Flash toggles the Flashblock extension which replaces Flash objects with a button F2 > Page Display > Content Filters

Thanks hrs. I do understand that. When one installs clearflashcookies.7z there is a new menu entry:
Tools->privacy->clear data->Clear flash cookies
In addition to
Tools > Privacy > Block Flash

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: Mtestlab
Date: June 09, 2011 10:47PM

Quote
siria
Actually, in my current skin and in Klassic that default button is called "KILL Flash", and that is yet another thing ;-) This doesn't toggle any setting, but it STOPS and kills already running flash stuff.

To configure any buttons, click on
Edit > Configuration > Toolbars

Use Ctrl+F to jump to the Kill Flash button.

It's not as complicated as it looks at first, really. An explanation is contained. And this code stuff gives you extreme freedom for customization!

So now you have all possibilities, depending on what you want to do?

E.g. copy and modify that whole button, to have 2 flash buttons: "Kill Flash" + "Clear flash cookies".

Or copy that button, hide the original version with comment signs # and modify the second button to use instead of "Kill" the "clearflash" macro command (don't know the exact name of it, the file has expired for download, but just open the macro file yourself (...flash...kmm) and look at the SETMENU lines at the end. Find the "setmenu....,"Clear Flash cookies",???,..." line and ??? is the command name you need. Use this for your button.

Or you could keep the normal Kill-Flash button as it is, and just add the Clear-menu to it as right-click context menu:
macros(JS_killFlash)|&Clear Data
This shows the menu to "Clear cache", "Clear Cookies", "Clear Passwords", ... etc. if you right-click on the Flash button.
Adding this menu does not require you to figure out any macro command names, so that slightly complicated italic stuff above is not needed.

Personally I prefer to have the
"Kill" menu as right-click on the Kill-Flash-button:
macros(JS_killFlash)|_Privacy_Kill
and to have the
"Clear" menu as right-click on the clear-cache-button
privacy(ClearCache)|&Clear Data
smiling smiley

Wow!! Thanks a bunch siria!smiling smiley Your explination is clear and it's working!. Firstly I now understand and have properly tested the default Kill Flash button and though I may not need it, I'll let it "sit" for a while. I did as you said and edited my toolbars.cfg to read thus:
Kill Flash{
macros(JS_killFlash)
Kill Flash Objects
privbar_red.bmp[12]
privbar_green.bmp[12]
}

Clear Flash Cookies{
macros(FlashCookiesCleaner,2)
Clear Flash Cookies
privbar_red.bmp[12]
privbar_green.bmp[12]
}
Thanks so much! Once again K-M proves to be The REAL Browser!!grinning smiley

Now I can delete those flash cookies with one fell swoop!

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: siria
Date: June 09, 2011 11:31PM

Ah nice, someone who really likes the freedom of this browser, that's rare! smiling smiley

And you got it right, uhm, almost, because that ",2" doesn't belong there (though it probably doesn't harm):
macros(FlashCookiesCleaner,2)

In the setmenu-line this number defines the position in the menu, the line number.
But you're giving me ideas there, never thought of it yet, perhaps it's actually possible to start several macro commands with 1 button?? Would be worth testing...

Anyway, suggestion to replace
macros(FlashCookiesCleaner,2)
with
macros(FlashCookiesCleaner)|&Clear Data

Just removed the ,2 and added the clear menu if you right-click on that button, little bonus huh smiling smiley

Options: ReplyQuote
Re: Clear Flash Cookies toolbar button?
Posted by: Mtestlab
Date: June 10, 2011 12:05AM

Yep! That works nice. But now you've done it!drool smiley

Is it possible to:

1] Right click that button with an option to view the cookies folder (C:\WINDOWS\Application Data\Macromedia\Flash Player)?

2] hack privbar_red.bmp[12] & privbar_green.bmp[12] to add a new button to show a different name for the Clear Flash Cookie button (which is the default "Flash" button right now.

Now I'm being spoiled and a bit over curious. Don't sweat it. Thanks again!!

Options: ReplyQuote
Re: new toolbar button, with menu on right-click
Posted by: siria
Date: June 10, 2011 05:17AM

Curious is good, that's where the fun starts! grinning smiley
If one is ready to work a bit for it ;-)

1) Add command to open macromedia folder

Generally: On right-click one can only add menus, not direct commands.
But since you already have the "Clear Data" menu on right-click, lets create and add a new "open flash folder" command to this menu.

A command to open this specific folder doesn't exist yet (unless in your macro?), but you can create it yourself with a new little macro. Good that you know the exact path which you want on your machine, otherwise I'd have a prob ;-)
And not sure if all systems allow to call the explorer from a browser macro, guess it depends on your personal security settings. But win98 isn't so 'picky' tongue sticking out smiley grinning smiley

Macro that adds "Open flash cookies folder" to the menu "Clear Data"
Example is only for path:
C:\WINDOWS\Application Data\Macromedia\Flash Player

Open notepad or another "Editor", copy the blue code into a new file and save it into your macros folder. Name doesn't matter, but the ending must be ".kmm", not ".txt", that's important. Save as "all files *.*" or whatever that's called.

----------

mtestlab_flashDirEx{
macroinfo=_("Open Explorer: Flash Cookies folder (appdata/macromedia)");
$_path="C:\\WINDOWS\\Application Data\\Macromedia\\Flash Player";
exec("explorer.exe /e,\"".$_path."\"");
}

mtestlab_flashDirKM{
macroinfo=_("View Flash Cookies folder in browser (appdata/macromedia)");
$OpenURL="file:///C:/WINDOWS/Application Data/Macromedia/Flash Player";
&OpenURL_InNew;
}

_mtestlab_BuildMenu{
setmenu("&Clear Data",separator,-1);
setmenu("&Clear Data",macro,"Open Flash Dir (in explorer)","mtestlab_flashDirEx",-1);
setmenu("&Clear Data",macro,"Open Flash Dir (in browser)","mtestlab_flashDirKM",-1);
}

$OnInit=$OnInit."_mtestlab_BuildMenu;";
$macroModules=$macroModules."mtestlab;";


-------------

Notes: Path must exist, or doesn't work.
Example above is for english Win98.
In XP or younger use this for the Explorer path:
$_path="%appdata%\\Macromedia\\Flash Player";

2nd command: Can't get it to open with %appdata% in browser, only hard-coded path works :-(
Other example paths:
Win98, Deutsch: C:/WINDOWS/Anwendungsdaten/Macromedia/Flash Player
VISTA default path, exchange user name:
C:/Users/Michelangelo/AppData/Roaming/Macromedia/Flash Player

-------------

Of course you or anyone else can play with that macro, change path or names or statusbar (=macroinfo) or menu description! smiling smiley
Just keep the touchy syntax, the infamous semi-colons and " and / and {} and \\ etc.
If you mess it, the browser may not start anymore or lose the Tools menu or other scary things, but you can always repair that by simply deleting that file again and start anew ;-)
There's also a very helpful "Error Console" in the Tools menu: click on "KMM" to show also macro errors.

-------------

2) other button image:

No prob in KM, if you already have a new image, or paint a button yourself cool smiley
Personally I just copy an existing image, then change it a bit with good old MS Paint ;-)
Okay, how to: look inside your current skin folder, it's in the K-Meleon program folder usually. There are a bunch of images in bmp format. The names vary from skin to skin. In yours there's an image privbar_red.bmp and privbar_green.bmp (guess Klassic skin). Double-click to view them. Each of the two contains a row of a dozen or so icons. And the [12] in the toolbars.cfg just means "button number 13 in that row".

Now copy or somehow create your own buttons bmp. Name is free, perhaps privbarMine_green.bmp or whatever. Important is only that each single image on it has the exact same size as the other buttons in the same toolbar, the privbar. The red and green states you can either put into two different bmp's, or both side-by-side into the same bmp, both is possible. Or even append the new images to the existing privbar-bmp's, but that's a bit risky to accidentally overwrite it and lose it some day.
Then create a new folder: "skins/default"
Put the new image(s) into it, from the default folder you can use it with all other skins as well.
Edit again your button in toolbars.cfg, change the bmp to the new name, and if the new bmp contains more than 1 image in a row, update the new position number(0= 1st image, 1 = 2nd image etc.)

The magenta background means "transparent" in KM, works only if it's the exact same color as in Klassic skin. It's also possible to define transparency with some other ways, as it works in the KM1.6 default skin Aura, but that's too complicated for me ;-P

Attention with skin changes:
If a default skin is customized and later one updates the browser, you probably overwrite the personal changes and lose them! To avoid this it helps a bit to copy the used skin folder and give it an own name. Better yet, move it into the profile folder, since most users keep their profile when updating but they usually delete the KM program folder, forgetting this deletes customized macros and skins, unless they are placed into the profile folder.

Options: ReplyQuote
Re: new toolbar button, with menu on right-click
Posted by: Mtestlab
Date: June 10, 2011 11:00PM

This is great siria. As I implement the things I learn on the forum, I naturally get better at the whole regarding K-M customization. This browser never ceases to amaze me!grinning smiley

The macro has worked like a charm! Having the option to open either in explorer or browser is fantastic!.

One oversight on my part I must point out:
The path I originally stated for the flash cookies:
C:\WINDOWS\Application Data\Macromedia\Flash Player

is fine IF there has been NO flash cookie deletion prior to using the menu macro. If there has been a use of the clear flash cookie button first, "\Flash Player" directory is completely deleted leading the menu macro reporting: "Directory doesn't exist" etc.

So I modified the line to read:
C:\WINDOWS\Application Data\Macromedia

Comming next: .bmp button tweaks!

Options: ReplyQuote
Re: new toolbar button, with menu on right-click
Posted by: Mtestlab
Date: June 13, 2011 11:40PM

The priv bar button .bmp skin tweak worked great. Thanks so much for the info that enabled me to do/learn this!smiling smiley

I created a new single button bitmap and copied a blue trash can and the letters Clr Fls Cook with the magenta background and saved it to Klassic skin folder as FlashCookprivbar.bmp.
Note: limited allowed space for the button forced the abbreviation(?) I think.

went to C:\Program Files\K-Meleon\skins\Klassic\toolbars.cfg

and overwrote:
Clear Flash Cookies{
macros(FlashCookiesCleaner)|&Clear Data
Clear Flash Cookies
privbar_red.bmp[12]
privbar_green.bmp[12]
}
to:
Clear Flash Cookies{
macros(FlashCookiesCleaner)|&Clear Data
Clear Flash Cookies
FlashCookprivbar.bmp[0]
FlashCookprivbar.bmp[0]
}


Looks cool!cool smiley

Options: ReplyQuote


K-Meleon forum is powered by Phorum.