зеркало из https://github.com/mozilla/pjs.git
13084 [PP]Use current page to set homepage doesn't work
This commit is contained in:
Родитель
dd3fe33472
Коммит
87097f796a
|
@ -76,7 +76,7 @@
|
|||
<html:input name="homepage" type="text" id="pref:string:browser.startup.homepage" size="30" />
|
||||
<html:div>
|
||||
<spring flex="100%"/>
|
||||
<titledbutton name="starts" type="button" value="&useCurrent;" />
|
||||
<titledbutton name="starts" type="button" value="&useCurrent;" onclick="SetHomePageToCurrentPage();" />
|
||||
<titledbutton name="browse" type="button" value="&browseFile;" />
|
||||
</html:div>
|
||||
</html:fieldset>
|
||||
|
|
|
@ -49,3 +49,27 @@ function StartUp(windowName)
|
|||
browser.openWindow();
|
||||
toolkit.CloseWindow( window );
|
||||
}
|
||||
|
||||
function SetHomePageToCurrentPage()
|
||||
{
|
||||
dump("SetHomePageToCurrentPage() \n ");
|
||||
var windowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService();
|
||||
var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);
|
||||
|
||||
|
||||
var topWindowOfType = windowManagerInterface.GetMostRecentWindow( "navigator:browser" );
|
||||
if ( topWindowOfType )
|
||||
{
|
||||
var inputfield = document.getElementById("pref:string:browser.startup.homepage");
|
||||
dump( "window found "+inputfield+"\n");
|
||||
if ( inputfield )
|
||||
{
|
||||
dump("setting home page to "+topWindowOfType.content.location.href+"\n");
|
||||
inputfield.value = topWindowOfType.content.location.href;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dump(" No browser window. Should be disabling this button \n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<html:input name="homepage" type="text" id="pref:string:browser.startup.homepage" size="30" />
|
||||
<html:div>
|
||||
<spring flex="100%"/>
|
||||
<titledbutton name="starts" type="button" value="&useCurrent;" />
|
||||
<titledbutton name="starts" type="button" value="&useCurrent;" onclick="SetHomePageToCurrentPage();" />
|
||||
<titledbutton name="browse" type="button" value="&browseFile;" />
|
||||
</html:div>
|
||||
</html:fieldset>
|
||||
|
|
Загрузка…
Ссылка в новой задаче