Bug 1088247 - A developer tool should only be enabled when appropriate actors exist. r=jryans

This commit is contained in:
James Long 2014-10-27 14:28:00 -04:00
parent b17ce55303
commit 338b843a08

View File

@ -117,7 +117,7 @@ Tools.inspector = {
},
isTargetSupported: function(target) {
return !target.isAddon;
return !target.isAddon && target.hasActor("inspector");
},
build: function(iframeWindow, toolbox) {
@ -199,7 +199,8 @@ Tools.styleEditor = {
commands: "devtools/styleeditor/styleeditor-commands",
isTargetSupported: function(target) {
return !target.isAddon;
return !target.isAddon &&
(target.hasActor("styleEditor") || target.hasActor("styleSheets"));
},
build: function(iframeWindow, toolbox) {
@ -267,7 +268,7 @@ Tools.jsprofiler = {
isTargetSupported: function (target) {
// Hide the profiler when debugging devices pre bug 1046394,
// that don't expose profiler actor in content processes.
return !target.isAddon && (!target.isApp || target.form.profilerActor);
return !target.isAddon && target.hasActor("profiler");
},
build: function (frame, target) {
@ -291,9 +292,7 @@ Tools.performance = {
inMenu: true,
isTargetSupported: function (target) {
// Hide the profiler when debugging devices pre bug 1046394,
// that don't expose profiler actor in content processes.
return !target.isAddon && (!target.isApp || target.form.profilerActor);
return !target.isAddon && target.hasActor("profiler");
},
build: function (frame, target) {
@ -338,8 +337,7 @@ Tools.netMonitor = {
inMenu: true,
isTargetSupported: function(target) {
let root = target.client.mainRoot;
return !target.isAddon && (root.traits.networkMonitor || !target.isApp);
return !target.isAddon && target.getTrait("networkMonitor");
},
build: function(iframeWindow, toolbox) {