зеркало из https://github.com/mozilla/gecko-dev.git
Make xremote xfeDoCommand(openBrowser) open with the user's start page instead of always opening about:blank. Bug 250064, r+sr=blizzard.
This commit is contained in:
Родитель
5229c8ccbb
Коммит
b2c03f3f3e
|
@ -71,6 +71,7 @@
|
|||
#include <nsCExternalHandlerService.h>
|
||||
#include <nsIExternalProtocolService.h>
|
||||
#include <nsIProfile.h>
|
||||
#include <nsICmdLineHandler.h>
|
||||
|
||||
NS_DEFINE_CID(kWindowCID, NS_WINDOW_CID);
|
||||
|
||||
|
@ -1004,11 +1005,21 @@ XRemoteService::XfeDoCommand(nsCString &aArgument,
|
|||
|
||||
// open a new browser window
|
||||
else if (aArgument.LowerCaseEqualsLiteral("openbrowser")) {
|
||||
// Get the browser URL and the default start page URL.
|
||||
nsCOMPtr<nsICmdLineHandler> browserHandler =
|
||||
do_GetService("@mozilla.org/commandlinehandler/general-startup;1?type=browser");
|
||||
|
||||
if (!browserHandler)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsXPIDLCString browserLocation;
|
||||
GetBrowserLocation(getter_Copies(browserLocation));
|
||||
if (!browserLocation)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
browserHandler->GetChromeUrlForTask(getter_Copies(browserLocation));
|
||||
|
||||
nsXPIDLString startPage;
|
||||
browserHandler->GetDefaultArgs(getter_Copies(startPage));
|
||||
|
||||
arg->SetData(startPage);
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> newWindow;
|
||||
rv = OpenChromeWindow(0, browserLocation, "chrome,all,dialog=no",
|
||||
arg, getter_AddRefs(newWindow));
|
||||
|
|
Загрузка…
Ссылка в новой задаче