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:
Edward Lee 2012-04-26 16:55:25 -07:00
Родитель a489c743b0
Коммит 60337e8f54
3 изменённых файлов: 13 добавлений и 10 удалений

Просмотреть файл

@ -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>