Improvement requests :  K-Meleon Web Browser Forum
Use this forum to talk about a feature you're missing. 
PopupMacro
Posted by: Rick Diaz
Date: August 20, 2002 05:26PM

I have this Macro im trying to build for adding to the list of sites that popup windows are disabled:

AddSiteToPopUp{
menu="Do Not Allow Popups From This Site";
$tmp = getclipboard();

id(ID_SELECT_URL);
id(ID_EDIT_COPY);
$location = getclipboard();

$Sites=getpref(STRING,"capability.policy.restrictedpopups.sites") . $location . ",";

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

the only problem is that the location is the whole location
ex. http://www.wakka.com/here/dammit.html
when I just need the hostname. i tried opening a window with the
open("javascript:location.href=location.hostname");
to cut and past the hostname then return it back to normal
but for some reason that returns me
http://kmeleon.sourceforge.net/kmeleon.sourceforge.net

Thanks
Rick

Options: ReplyQuote
Re: PopupMacro
Posted by: Robert
Date: September 21, 2002 01:26PM

In the latest beta, there is the posibility, to do this with:

AddSiteToPopUp {
menu="Do Not Allow Popups From This Site";
$new=hostname($URL);
$result=confirm("Add ".$new." ?", "Do Not Allow Popups From This Site");
macros("AddSiteToPopUp_".$result)
}

AddSiteToPopUp_OK {
$sites=getpref(STRING,"capability.policy.restrictedpopups.sites") . $new . ",";
setpref(STRING,"capability.policy.restrictedpopups.sites",$sites);
$StatusString="Pop up Menus from " . $new . " Restricted";
statusbar($StatusString);
}

AddSiteToPopUp_0 {
}

Options: ReplyQuote


K-Meleon forum is powered by Phorum.