mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
Bug 1088247 - A developer tool should only be enabled when appropriate actors exist. r=jryans
This commit is contained in:
parent
2315b2d0d9
commit
40adb607b4
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user