Bug 1297758 - Throw when accessing any unimplemented toolbox function when loading inspector in a tab. r=pbro

MozReview-Commit-ID: AsI0Fluyu7j
This commit is contained in:
Alexandre Poirot 2016-09-29 10:02:29 -07:00
parent fe2bd4d67a
commit 5df990c711

View File

@ -1853,6 +1853,9 @@ if (url.search.length > 1) {
Task.spawn(function* () {
let target = yield targetFromURL(url);
let notImplemented = function () {
throw new Error("Not implemented in a tab");
};
let fakeToolbox = {
target,
hostType: "bottom",
@ -1873,6 +1876,21 @@ if (url.search.length > 1) {
isToolRegistered() {
return false;
},
currentToolId: "inspector",
getCurrentPanel() {
return "inspector";
},
get textboxContextMenuPopup() {
notImplemented();
},
getPanel: notImplemented,
openSplitConsole: notImplemented,
viewCssSourceInStyleEditor: notImplemented,
viewJsSourceInDebugger: notImplemented,
viewSource: notImplemented,
viewSourceInDebugger: notImplemented,
viewSourceInStyleEditor: notImplemented,
// For attachThread:
highlightTool() {},
unhighlightTool() {},