mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
b=445993, r=gavin. target=_blank doesn't load the URL
This commit is contained in:
parent
6d9fb9182b
commit
3b50f8427c
@ -107,20 +107,23 @@ var Browser = {
|
||||
|
||||
Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
|
||||
|
||||
// Determine the initial launch page
|
||||
var whereURI = null;
|
||||
try {
|
||||
// Use a homepage
|
||||
whereURI = this.prefs.getCharPref("browser.startup.homepage");
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
|
||||
// Use a commandline parameter
|
||||
// If this is an intial window launch (was a nsICommandLine passed via window params)
|
||||
// we execute some logic to load the initial launch page
|
||||
if (window.arguments && window.arguments[0]) {
|
||||
var whereURI = null;
|
||||
|
||||
try {
|
||||
// Try to access the commandline
|
||||
var cmdLine = window.arguments[0].QueryInterface(Ci.nsICommandLine);
|
||||
|
||||
try {
|
||||
// Check for and use a default homepage
|
||||
whereURI = this.prefs.getCharPref("browser.startup.homepage");
|
||||
} catch (e) {}
|
||||
|
||||
// Check for and use a single commandline parameter
|
||||
if (cmdLine.length == 1) {
|
||||
// Assume the first arg is a URI if it is not a flag
|
||||
var uri = cmdLine.getArgument(0);
|
||||
if (uri != "" && uri[0] != '-') {
|
||||
whereURI = cmdLine.resolveURI(uri);
|
||||
@ -128,15 +131,21 @@ var Browser = {
|
||||
whereURI = whereURI.spec;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for the "url" flag
|
||||
uriFlag = cmdLine.handleFlagWithParam("url", false);
|
||||
if (uriFlag) {
|
||||
whereURI = cmdLine.resolveURI(uriFlag);
|
||||
if (whereURI)
|
||||
whereURI = whereURI.spec;
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
|
||||
if (whereURI) {
|
||||
var self = this;
|
||||
setTimeout(function() { self.content.browser.loadURI(whereURI, null, null, false); }, 10);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
setupGeolocationPrompt: function() {
|
||||
|
Loading…
Reference in New Issue
Block a user