Add N Edit Cookies
Posted by: Matt
Date: September 14, 2009 12:45PM

It works almost perfectly. Only one issue: after clicking "New expirations date" it should look like this



but in K-Meleon it looks as follows



Is it possible to change window size and how? Any help?

Download Add N Edit Cookies. Access via Tools menu.

More infos here.



Edited 1 time(s). Last edit at 09/14/2009 03:57PM by Matt.

Re: Add N Edit Cookies
Posted by: disrupted
Date: September 14, 2009 04:31PM

nice one, the interface theme is not a problem, it's just that in firefox it follows the theme used or userchrome and in k-meleon it uses windows own theme. i added it to privacy page and changed the menu location to tools>privacy>cookies manager also added password generator and added an extra menu to the context menu of text input fields. bandwidth tester added under network but unfortunately better gmal2 did not work it functions through jscript and not hostperm. thanks matt.

Re: Add N Edit Cookies
Posted by: disrupted
Date: September 14, 2009 06:46PM

sorry i misunderstand what you meant.. the autoresize of a dialog or window is handled by firefox xul manipulator so you'll notice that some xul extensions does no include fixed size properties which can cause problems in kmeleon when some of the dialog elemts become outside. this is very easy to fix by explanding the jar and opening the xul with the problem.. in our case it's 'editCookie.xul'

you will find this section in the beginning of the xul..this informs the browser how to draw the dialog:

<window id="CookieEditDlg"
				title="&CookieEditDlg.title.label;"
				xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
				persist="width height screenX screenY"
				onload="InitEditCookie()">
	<script type="application/x-javascript" src="addneditcookies.js"/>
	<script type="application/x-javascript" src="editCookie.js"/>
	<script type="application/x-javascript" src="libOut.js"/>
	<script type="application/x-javascript" src="datepicker/user-functions.js" />


you see it does not include exact height,width to let the browser handle it according to which elemnts are collapsed (persist="width height screenX screenY")

we fix the problem by including an exact width and height which includes the hidden elements so they are displayed properly when expanded
<window id="CookieEditDlg"
				title="&CookieEditDlg.title.label;"
				xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
				persist="width height screenX screenY"
				onload="InitEditCookie()">
				height="342"
				width="496"
	<script type="application/x-javascript" src="addneditcookies.js"/>
	<script type="application/x-javascript" src="editCookie.js"/>
	<script type="application/x-javascript" src="libOut.js"/>
	<script type="application/x-javascript" src="datepicker/user-functions.js" />

another problem you might face with some extensions like in edit/add cokies is their prefs file. with some extensions the file name is unique to the extension itself.. no problem there you can use this file as is and add to k-meleon prefs folder but with some extensions the prefs file is not unique and is just named prefs meaning its settings are directly called from fireshit.. but you can't save this file in k-meleon prefs because k-meleon will not understand what to do with it or call the extension's default settings from it.. i see you understood that problem and renamed the file to addneditcookies-preferences.js but k-meleon cannot get the default settings from that file either because the prefs file name must be exactly as the sub category it adds in the browser prefs.js.. in this case it's only 'addneditcookies.js'.

it's very easy to find out the right name for the extension prefs file, you just open that prefs file in notepad and take note of its general setting name.. in that case L

live">pref("addneditcookies.displaydeleteconfirmation", true);
pref("addneditcookies.lastsearch.host", "");
pref("addneditcookies.lastsearch.name", "");


this means that the right name for the prefs file inside kmeleon should be
addneditcookies.js

you can download revised add/edit extension from the privacy page>cookies manager
thanks matt for your contributions and keep them coming!

Re: Add N Edit Cookies
Posted by: Matt
Date: September 15, 2009 06:31PM

Strange, I edited editCookie.xul but without effect. The window does not have the desired dimension :O.

Quote
disrupted
this means that the right name for the prefs file inside kmeleon should be addneditcookies.js

But the name is still 'addneditcookies-preferences.js'. I downloaded it from http://kmext.sourceforge.net/

Quote
disrupted
thanks matt for your contributions and keep them coming!

Could you test this one? The options windows displays correctly but i.e. favicons and numeration in search results don't display at all. I'm afraid it might be another faux pas like better gmail was :B.

Anyway thank you very much for your reply, disrupted and for previous contributions.

Re: Add N Edit Cookies
Posted by: disrupted
Date: September 15, 2009 07:03PM

strange, i'm pretty sure i've uploaded the revised one.. maybe i uploaded it to the wrong directory macros or to root

i uploaded it again
http://kmext.sourceforge.net/files/cookman.7z



i'll check that other one aswell

Re: Add N Edit Cookies
Posted by: guenter
Date: September 15, 2009 07:20PM

onload="InitEditCookie()">
height="342"
width="496"


Probably has a typo. Very hard to see in Forum.
It must probably get the closing after width="496"> else there is not a closed, valid expression. Try it like that.

Here is an working example from mimetypes pref.xul.
It uses relative size em

<dialog id="prefDialog"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
title="&mtypes.title;"
style="width:50em;height:40em"
windowtype="mozilla:preferences"
contextmenu="0"
buttons="accept,cancel"
onload="onLoad();"
ondialogaccept="return hPrefWindow.onAccept();"
ondialogcancel="return hPrefWindow.onCancel();"
persist="screenX screenY width height">

It is closed at the end.


Look into pref.xul of kmprefs for another way (example) of doing it.

<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
id="prefDialog" title="&prefDialog.title;" style="&prefDialog.style;"

kko uses a style element defined outside.
Some lines later also comes the closing >.

In kmprefs' locale pref.dtd, kko defines the style's sizes.
The bold section is normally translated but not here.
So why was it placed here?

It gives relative size in em and also gives it to translator to adapt the size of the window to accomodate e.g. Polish or German.... translation.

<!ENTITY prefDialog.style "width: 68.5em; height: 55em;">

We non English probably want to do it like kko did smiling smiley

Try it also. IMHO it is better.

I did not know all this when I created mimetypes 0.3 from Mozilla 1.7 sources.

p.s. Special thanx go to disrupted for explaining every thing to me in this thread.



Edited 5 time(s). Last edit at 09/16/2009 01:24PM by guenter.

Re: Add N Edit Cookies
Posted by: Matt
Date: September 18, 2009 11:37AM

Finally, it works smiling smiley.

<window id="CookieEditDlg"				


	title="&CookieEditDlg.title.label;"				
	xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";				
	persist="width height screenX screenY"				
	onload="InitEditCookie()"				
	height="342"				
	width="526">

I changed the width value for better visual effect and translated this great extension.

Vielen Dank für die Tipps.

Regards
Matt

K-Meleon forum is powered by Phorum.