Browse Source

If the (non-existent) Web Console isn't there then fall back to error console for content script errors

custom-2020
Matt A. Tobin 2 years ago committed by Roy Tam
parent
commit
859e555a82
  1. 13
      communicator/components/devtools/content/scratchpad/scratchpad.js
  2. 2
      communicator/components/devtools/moz.build

13
communicator/components/devtools/content/scratchpad/scratchpad.js

@ -239,7 +239,7 @@ var Scratchpad = {
let contentWindow = this.gBrowser.selectedBrowser.contentWindow;
let scriptError = Cc["@mozilla.org/scripterror;1"].
createInstance(Ci.nsIScriptError2);
createInstance(Ci.nsIScriptError);
scriptError.initWithWindowID(ex.message + "\n" + ex.stack, ex.fileName,
"", ex.lineNumber, 0, scriptError.errorFlag,
@ -557,10 +557,15 @@ var Scratchpad = {
*/
openWebConsole: function SP_openWebConsole()
{
if (!this.browserWindow.HUDConsoleUI.getOpenHUD()) {
this.browserWindow.HUDConsoleUI.toggleHUD();
try {
if (!this.browserWindow.HUDConsoleUI.getOpenHUD()) {
this.browserWindow.HUDConsoleUI.toggleHUD();
}
this.browserWindow.focus();
}
catch (ex) {
this.openErrorConsole();
}
this.browserWindow.focus();
},
/**

2
communicator/components/devtools/moz.build

@ -5,6 +5,6 @@
EXTRA_JS_MODULES.communicator.devtools += ['modules/PropertyPanel.jsm']
JS_PREFERENCE_PP_FILES += ['devtools-prefs.js']
JS_PREFERENCE_FILES += ['devtools-prefs.js']
JAR_MANIFESTS += ['jar.mn']
Loading…
Cancel
Save