firefox addon page url
I have a Firefox addon, in which I have to obtain the URL of the calling web page.
My calling web page is opened as a radwindow insidedefault.aspx
.
When I use开发者_运维百科 window.content.document.location.href
, it returns the default page address.
How can I obtain the URL of the opened radwindow.
You can try with this example,
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well)
return oWindow;
}
GetRadWindow().BrowserWindow.location.href;
精彩评论