Development :  K-Meleon Forum
K-Meleon development related discussions. 
Javascript Commands in Macros
Posted by: Rick Diaz
Date: August 13, 2002 02:55AM

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 13, 2002 03:28AM

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 13, 2002 03:44AM

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 13, 2002 06:00AM

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 26, 2002 04:13AM

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.