зеркало из https://github.com/mozilla/gecko-dev.git
Bug 732631 - Selecting to a open a new window within an app, then exiting the app does not shut down the application [r=myk]
Switch browser type to content-primary so the frame loader triggers the right behavior for adding a content shell. Also fixes Bug 746217 - Cannot open windows even from the same domain
This commit is contained in:
Родитель
a489c743b0
Коммит
60337e8f54
|
@ -25,11 +25,12 @@ CommandLineHandler.prototype = {
|
|||
QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]),
|
||||
|
||||
handle: function handle(cmdLine) {
|
||||
// Open the window with arguments to identify it as the main window
|
||||
Services.ww.openWindow(null,
|
||||
"chrome://webapprt/content/webapp.xul",
|
||||
"_blank",
|
||||
"chrome,dialog=no,all,resizable",
|
||||
null);
|
||||
[]);
|
||||
},
|
||||
|
||||
helpInfo : "",
|
||||
|
|
|
@ -12,17 +12,19 @@ Cu.import("resource://gre/modules/Services.jsm");
|
|||
function onLoad() {
|
||||
window.removeEventListener("load", onLoad, false);
|
||||
|
||||
let installRecord = WebappRT.config.app;
|
||||
// Set the title of the window to the name of the webapp
|
||||
let manifest = WebappRT.config.app.manifest;
|
||||
|
||||
// Set the title of the window to the name of the webapp.
|
||||
document.documentElement.setAttribute("title", manifest.name);
|
||||
|
||||
// Load the webapp's launch path.
|
||||
let url = Services.io.newURI(installRecord.origin, null, null);
|
||||
if (manifest.launch_path)
|
||||
url = Services.io.newURI(manifest.launch_path, null, url);
|
||||
document.getElementById("content").setAttribute("src", url.spec);
|
||||
// Only load the webapp on the initially launched main window
|
||||
if ("arguments" in window) {
|
||||
// Load the webapp's launch URL
|
||||
let installRecord = WebappRT.config.app;
|
||||
let url = Services.io.newURI(installRecord.origin, null, null);
|
||||
if (manifest.launch_path)
|
||||
url = Services.io.newURI(manifest.launch_path, null, url);
|
||||
document.getElementById("content").setAttribute("src", url.spec);
|
||||
}
|
||||
}
|
||||
window.addEventListener("load", onLoad, false);
|
||||
|
||||
|
|
|
@ -151,6 +151,6 @@
|
|||
</menu>
|
||||
</menubar>
|
||||
|
||||
<browser type="content" id="content" flex="1"/>
|
||||
<browser type="content-primary" id="content" flex="1"/>
|
||||
|
||||
</window>
|
||||
|
|
Загрузка…
Ссылка в новой задаче