Bug 993101 - Add main-process debug button. r=paul

This commit is contained in:
Alexandre Poirot 2014-04-08 14:13:09 -04:00
parent ca5c8f2349
commit 21876b71a3
4 changed files with 29 additions and 0 deletions

View File

@ -122,6 +122,14 @@ let UI = {
this.setWallpaper(dataURL);
});
});
if (Services.prefs.getBoolPref("devtools.chrome.enabled")) {
let rootButton = document.getElementById("root-actor-debug");
if (response.consoleActor) {
rootButton.removeAttribute("hidden");
} else {
rootButton.setAttribute("hidden", "true");
}
}
}
);
}
@ -143,6 +151,21 @@ let UI = {
if (panel) panel.classList.add("selected");
},
openToolboxForRootActor: function() {
if (!this.connected) {
return;
}
let options = {
form: this.listTabsResponse,
client: this.connection.client,
chrome: true
};
devtools.TargetFactory.forRemoteTab(options).then((target) => {
top.UI.openAndShowToolboxForTarget(target, "Main process", null);
});
},
openToolboxForApp: function(manifest) {
if (!this.connected) {
return;

View File

@ -35,6 +35,7 @@
<span template='{"type":"textContent","path":"device.description.geckoversion"}'></span>
</h3>
<p template='{"type":"localizedContent","property":"device.deviceSize", "paths":["device.description.width","device.description.height","device.description.dpi"]}'></p>
<button id="root-actor-debug" hidden="true" onclick="UI.openToolboxForRootActor()" title="&device.debugMainProcessTooltip;">&device.debugMainProcess;</button>
</header>
<div id="tabs-headers">
<div onclick="UI.setTab('apps')" class="tab sidebar-item apps" title="&device.installedAppsTooltip;">&device.installedApps;</div>

View File

@ -7,6 +7,8 @@
<!ENTITY index.device2 "Device">
<!ENTITY index.help "Help">
<!ENTITY device.debugMainProcess "Debug main process">
<!ENTITY device.debugMainProcessTooltip "Open the Developer Tools connected to the main process on the device">
<!ENTITY device.screenshot "Screenshot">
<!ENTITY device.screenshotTooltip "Open a screenshot of the current state of the device in a new tab">
<!ENTITY device.title "Device Control Center">

View File

@ -58,6 +58,9 @@ h1 {
}
#root-actor-debug {
background: white;
}
/***************** APP BUTTONS *****************/