mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1478273 - When clicked on the side bar pane, it disappears r=gl
Differential Revision: https://phabricator.services.mozilla.com/D3505 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
cbdc91569d
commit
892766091a
@ -3385,6 +3385,15 @@ Toolbox.prototype = {
|
||||
return extInfo && Services.prefs.getBoolPref(extInfo.pref, false);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a panel id in the case of built in panels or "other" in the case of
|
||||
* third party panels. This is necessary due to limitations in addon id strings,
|
||||
* the permitted length of event telemetry property values and what we actually
|
||||
* want to see in our telemetry.
|
||||
*
|
||||
* @param {String} id
|
||||
* The panel id we would like to process.
|
||||
*/
|
||||
getTelemetryPanelNameOrOther: function(id) {
|
||||
if (!this._toolNames) {
|
||||
const definitions = gDevTools.getToolDefinitionArray();
|
||||
@ -3392,9 +3401,11 @@ Toolbox.prototype = {
|
||||
|
||||
this._toolNames = new Set(definitionIds);
|
||||
}
|
||||
|
||||
if (!this._toolNames.has(id)) {
|
||||
return "other";
|
||||
}
|
||||
|
||||
return id;
|
||||
},
|
||||
};
|
||||
|
@ -332,7 +332,11 @@ ToolSidebar.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
currentToolId = this.getTelemetryPanelNameOrOther(currentToolId);
|
||||
|
||||
if (previousToolId) {
|
||||
previousToolId = this.getTelemetryPanelNameOrOther(previousToolId);
|
||||
|
||||
this._telemetry.toolClosed(previousToolId);
|
||||
|
||||
this._telemetry.recordEvent("devtools.main", "sidepanel_changed", "inspector", null,
|
||||
@ -346,6 +350,33 @@ ToolSidebar.prototype = {
|
||||
this._telemetry.toolOpened(currentToolId);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a panel id in the case of built in panels or "other" in the case of
|
||||
* third party panels. This is necessary due to limitations in addon id strings,
|
||||
* the permitted length of event telemetry property values and what we actually
|
||||
* want to see in our telemetry.
|
||||
*
|
||||
* @param {String} id
|
||||
* The panel id we would like to process.
|
||||
*/
|
||||
getTelemetryPanelNameOrOther: function(id) {
|
||||
if (!this._toolNames) {
|
||||
// Get all built in tool ids. We identify third party tool ids by checking
|
||||
// for a "-", which shows it originates from an addon.
|
||||
const ids = this._tabbar.state.tabs.map(({ id: toolId }) => {
|
||||
return toolId.includes("-") ? "other" : toolId;
|
||||
});
|
||||
|
||||
this._toolNames = new Set(ids);
|
||||
}
|
||||
|
||||
if (!this._toolNames.has(id)) {
|
||||
return "other";
|
||||
}
|
||||
|
||||
return id;
|
||||
},
|
||||
|
||||
/**
|
||||
* Show the sidebar.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user