Bug 340233 -inspector produces unsizable window r=timeless

This commit is contained in:
neil%parkwaycc.co.uk 2006-06-23 12:26:10 +00:00
parent b19aadfc37
commit db7888b79e

View File

@ -79,28 +79,31 @@ InspectorCmdLineHandler.prototype =
/* nsICommandLineHandler */ /* nsICommandLineHandler */
handle : function handler_handle(cmdLine) { handle : function handler_handle(cmdLine) {
var args; var args = Components.classes["@mozilla.org/supports-string;1"]
try {
var uristr = cmdLine.handleFlagWithParam("inspect", false);
if (uristr) {
var uri = cmdLine.resolveURI(uristr);
args = Components.classes["@mozilla.org/supports-string;1"]
.createInstance(nsISupportsString); .createInstance(nsISupportsString);
args.data = uri.spec; try {
var uristr = cmdLine.handleFlagWithParam("inspector", false);
if (uristr == null)
return;
try {
args.data = cmdLine.resolveURI(uristr).spec;
}
catch (e) {
return;
} }
} }
catch (e) { catch (e) {
cmdLine.handleFlag("inspector", true);
} }
if (args || cmdLine.handleFlag("inspector", false)) { var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"]
var wwatch = Components.classes["@mozilla.org/embedcomp/window-watcher;1"] .getService(nsIWindowWatcher);
.getService(nsIWindowWatcher); wwatch.openWindow(null, "chrome://inspector/content/", "_blank",
wwatch.openWindow(null, "chrome://inspector/content/", "_blank", "chrome,dialog=no,all", args);
"chrome,dialog=no,all", args); cmdLine.preventDefault = true;
}
}, },
helpInfo : " -inspect <url> Open the URL in the DOM inspector.\n -inspector Open the DOM inspector.\n" helpInfo : " -inspector <url> Open the DOM inspector.\n"
}; };