Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
Javascript Commands in Macros
Posted by: Rick Diaz
Date: August 12, 2002 07:55PM

I am trying to create a macro in .65 that would add sites to the no popup list. but i cannot find out how to get the location.hostname javascript to give me a value. is this even possible.

AddSiteToPopUp{
menu="Do Not Allow Popups From This Site";
$Sites=getpref(STRING,"capability.policy.restrictedpopups.sites") . "," . location.hostname;

setpref(STRING,"capability.policy.restrictedpopups.sites",$Sites);
$StatusString="Pop up Menus from " . location.hostname . " Restricted";
statusbar($StatusString);
}

Options: ReplyQuote
Re: Javascript Commands in Macros
Posted by: po
Date: August 12, 2002 08:28PM

i don't think 'location.hostname' means anything to the macro plugin - remember, it's not a javascript engine - so probably any js you actually want to execute would have to appear in the form of something like:

open(javascript:<stuff goes here>);

but i haven't done much of that, since i don't usually have js turned on. smiling smiley

Options: ReplyQuote
Re: Javascript Commands in Macros
Posted by: Rick Diaz
Date: August 12, 2002 08:44PM

The problem is that open(as far as i know) wont return me a value that i can use in setpref. Im just wondering if there is any command or way to get kmeleon to return a javascript value so I can set the new setpref.

Options: ReplyQuote
Re: Javascript Commands in Macros
Posted by: po
Date: August 12, 2002 11:00PM

off hand, the only kludge that comes to mind would be to use the clipboard as sort of a 'global buffer', since i think (i could be wrong) you could write to that with js, and i know it can be accessed with the macro plugin...? just a thought.

Options: ReplyQuote
Re: Javascript Commands in Macros
Posted by: TheWebDevGuy
Date: September 25, 2002 09:13PM

We gotta have javascript customization capability otherwise we're back to IE and it's proprietary junk!!!!

Yours Truly,
~TheRodster

a.k.a. Rodney Giles
Chief Engineering Architects
Toydrum Web & Media

Options: ReplyQuote


K-Meleon forum is powered by Phorum.