Skip to content

Commit d3a2765

Browse files
Bug 1936226 - [DevTools Release Tasks - Cycle 135] Remove backward compatibility code r=devtools-reviewers,nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D231674
1 parent f18dfad commit d3a2765

File tree

5 files changed

+5
-26
lines changed

5 files changed

+5
-26
lines changed

devtools/client/fronts/descriptors/webextension.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,8 @@ class WebExtensionDescriptorFront extends DescriptorMixin(
9898
}
9999

100100
isServerTargetSwitchingEnabled() {
101-
// @backward-compat { version 133 } Firefox 133 started supporting server targets by default.
102-
// Once this is the only supported version, we can remove the traits and consider this true,
103-
// but keep this method as some other descriptor still return false.
104-
// At least the browser toolbox doesn't support server target switching.
105-
return this.traits.isServerTargetSwitchingEnabled;
101+
// Since Firefox 133, this is always true for webextension toolboxes.
102+
return true;
106103
}
107104

108105
getWatcher() {

devtools/client/fronts/targets/target-mixin.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ function TargetMixin(parentClass) {
294294
this._url;
295295
}
296296

297-
if (this.isWebExtension || this.isContentProcess) {
297+
if (this.isContentProcess) {
298298
return this.targetForm.name;
299299
}
300300
return this.title;
@@ -315,18 +315,6 @@ function TargetMixin(parentClass) {
315315
);
316316
}
317317

318-
// @backward-compat { version 133 } Once 133 is released, this attribute can be removed.
319-
// This will never be true anymore. Instead the usage in 'name' getter will be irrelevant
320-
// as 'title' served by the backend will be correct for WebExtensions.
321-
get isWebExtension() {
322-
return !!(
323-
this.targetForm &&
324-
this.targetForm.actor &&
325-
(this.targetForm.actor.match(/conn\d+\.webExtension(Target)?\d+/) ||
326-
this.targetForm.actor.match(/child\d+\/webExtension(Target)?\d+/))
327-
);
328-
}
329-
330318
get isContentProcess() {
331319
// browser content toolbox's form will be of the form:
332320
// server0.conn0.content-process0/contentProcessTarget7

devtools/client/fronts/targets/window-global.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,8 @@ class WindowGlobalTargetFront extends TargetMixin(
8282
event.isFrameSwitching = packet.isFrameSwitching;
8383

8484
// Keep the title unmodified when a developer toolbox switches frame
85-
// for a tab (Bug 1261687), but always update the title when the target
86-
// is a WebExtension (where the addon name is always included in the title
87-
// and the url is supposed to be updated every time the selected frame changes).
88-
if (!packet.isFrameSwitching || this.isWebExtension) {
85+
// for a tab (Bug 1261687).
86+
if (!packet.isFrameSwitching) {
8987
this.setTitle(packet.title);
9088
this.setUrl(packet.url);
9189
}

devtools/server/actors/descriptors/webextension.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ class WebExtensionDescriptorActor extends Actor {
115115
supportsReloadDescriptor: true,
116116
// Supports the Watcher actor. Can be removed as part of Bug 1680280.
117117
watcher: true,
118-
// @backward-compat { version 133 } Firefox 133 started supporting server targets by default.
119-
// Once this is the only supported version, we can remove the traits and consider it always true in the frontend.
120-
isServerTargetSwitchingEnabled: true,
121118
},
122119
url: this.addon.sourceURI ? this.addon.sourceURI.spec : undefined,
123120
warnings: lazy.ExtensionParent.DebugUtils.getExtensionManifestWarnings(

devtools/server/tests/xpcshell/test_webextension_descriptor.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ add_task(async function test_listAddons_and_WebExtensionDescriptor() {
9797
traits: {
9898
supportsReloadDescriptor: true,
9999
watcher: true,
100-
isServerTargetSwitchingEnabled: true,
101100
},
102101
},
103102
"WebExtensionDescriptorActor content matches the add-on"

0 commit comments

Comments
 (0)