Bug 994659 - Fix exceptions when reloading shell.html. r=vingtetun

This commit is contained in:
Alexandre Poirot 2014-04-10 09:38:00 +02:00
parent efaffaba65
commit bbb8d810fa
3 changed files with 18 additions and 3 deletions

View File

@ -52,6 +52,10 @@ function checkDebuggerPort() {
// DebuggerServer.openListener detects that it isn't a file path (string),
// and starts listening on the tcp port given here as command line argument.
if (!window.arguments) {
return;
}
// Get the command line arguments that were passed to the b2g client
let args = window.arguments[0].QueryInterface(Ci.nsICommandLine);

View File

@ -5,6 +5,10 @@
let runAppObj;
window.addEventListener('load', function() {
if (!window.arguments) {
return;
}
// Get the command line arguments that were passed to the b2g client
let args = window.arguments[0].QueryInterface(Ci.nsICommandLine);
let appname;

View File

@ -57,12 +57,19 @@ window.addEventListener('ContentStart', function() {
};
// Get the command line arguments that were passed to the b2g client
let args = window.arguments[0].QueryInterface(Ci.nsICommandLine);
let screenarg;
let args;
try {
// On Firefox Mulet, we don't always have a command line argument
args = window.arguments[0].QueryInterface(Ci.nsICommandLine);
} catch(e) {}
let screenarg = null;
// Get the --screen argument from the command line
try {
screenarg = args.handleFlagWithParam('screen', false);
if (args) {
screenarg = args.handleFlagWithParam('screen', false);
}
// If there isn't one, use the default screen
if (screenarg === null)