Bug 1144392 - Show an error message in the Browser Toolbox if the connection fails. r=jryans

This commit is contained in:
Brian Grinstead 2015-03-17 14:55:00 -04:00
Родитель b962236373
Коммит 2cf633a3fb
3 изменённых файлов: 15 добавлений и 1 удалений

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

@ -62,7 +62,13 @@ window.addEventListener("load", function() {
let cmdClose = document.getElementById("toolbox-cmd-close");
cmdClose.addEventListener("command", onCloseCommand);
setPrefDefaults();
connect().catch(Cu.reportError);
connect().catch(e => {
let errorMessageContainer = document.getElementById("error-message-container");
let errorMessage = document.getElementById("error-message");
errorMessage.value = e;
errorMessageContainer.hidden = false;
Cu.reportError(e);
});
});
function onCloseCommand(event) {

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

@ -37,5 +37,9 @@
for example when viewing network request details. -->
<popupset id="mainPopupSet"></popupset>
<vbox id="error-message-container" hidden="true" flex="1">
<box>&browserToolboxErrorMessage;</box>
<textbox multiline="true" id="error-message" flex="1"></textbox>
</vbox>
<iframe id="toolbox-iframe" flex="1"></iframe>
</window>

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

@ -23,6 +23,10 @@
- It allows you to switch the context of the whole toolbox. -->
<!ENTITY toolboxFramesTooltip "Select an iframe as the currently targeted document">
<!-- LOCALIZATION NOTE (browserToolboxErrorMessage): This is the label
- shown next to error details when the Browser Toolbox is unable to open. -->
<!ENTITY browserToolboxErrorMessage "Error opening Browser Toolbox:">
<!-- LOCALIZATION NOTE (options.context.advancedSettings): This is the label for
- the heading of the advanced settings group in the options panel. -->
<!ENTITY options.context.advancedSettings "Advanced settings">