Bug 1693495 - [devtools] Remove getTabTarget in favor of Connector.currentTarget. r=devtools-reviewers,nchevobbe

Differential Revision: https://phabricator.services.mozilla.com/D166053
This commit is contained in:
Alexandre Poirot 2023-01-09 13:09:42 +00:00
Родитель 98fbab6206
Коммит 05b11fe363
4 изменённых файлов: 3 добавлений и 17 удалений

Просмотреть файл

@ -39,7 +39,6 @@ class Connector {
this.navigate = this.navigate.bind(this);
this.sendHTTPRequest = this.sendHTTPRequest.bind(this);
this.triggerActivity = this.triggerActivity.bind(this);
this.getTabTarget = this.getTabTarget.bind(this);
this.viewSourceInDebugger = this.viewSourceInDebugger.bind(this);
this.requestData = this.requestData.bind(this);
this.getTimingMarker = this.getTimingMarker.bind(this);
@ -480,14 +479,6 @@ class Connector {
return this.dataProvider.getLongString(stringGrip);
}
/**
* Getter that access tab target instance.
* @return {object} browser tab target instance
*/
getTabTarget() {
return this.currentTarget;
}
/**
* Getter that returns the current toolbox instance.
* @return {Toolbox} toolbox instance

Просмотреть файл

@ -235,8 +235,7 @@ function getDefaultTargetFile(options) {
Services.prefs.getCharPref("devtools.netmonitor.har.defaultLogDir");
const folder = HarUtils.getLocalDirectory(path);
const tabTarget = options.connector.getTabTarget();
const host = new URL(tabTarget.url);
const host = new URL(options.connector.currentTarget.url);
const fileName = HarUtils.getHarFileName(
options.defaultFileName,
options.jsonp,

Просмотреть файл

@ -78,8 +78,7 @@ const HarExporter = {
let data = await this.fetchHarData(options);
const tabTarget = options.connector.getTabTarget();
const host = new URL(tabTarget.url);
const host = new URL(options.connector.currentTarget.url);
const fileName = HarUtils.getHarFileName(
defaultFileName,
@ -193,15 +192,13 @@ const HarExporter = {
*/
async buildHarData(options) {
const { connector } = options;
const { getTabTarget } = connector;
const { title } = getTabTarget();
// Disconnect from redux actions/store.
connector.enableActions(false);
options = {
...options,
title,
title: connector.currentTarget.title,
getString: connector.getLongString,
getTimingMarker: connector.getTimingMarker,
requestData: connector.requestData,

Просмотреть файл

@ -179,7 +179,6 @@ function NetworkEventMessage({
getLongString: grip => {
return serviceContainer.getLongString(grip);
},
getTabTarget: () => {},
sendHTTPRequest: () => {},
triggerActivity: () => {},
requestData: (requestId, dataType) => {