Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 8f48af1

Browse files
committed
Bug 1699222 - browserSettings.ftpProtocolEnabled should return false r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D111252
1 parent f46bd47 commit 8f48af1

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

toolkit/components/extensions/parent/ext-browserSettings.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,6 @@ ExtensionPreferencesManager.addSetting("contextMenuShowEvent", {
7070
},
7171
});
7272

73-
ExtensionPreferencesManager.addSetting("ftpProtocolEnabled", {
74-
permission: "browserSettings",
75-
prefNames: ["network.ftp.enabled"],
76-
77-
setCallback(value) {
78-
return { [this.prefNames[0]]: value };
79-
},
80-
});
81-
8273
ExtensionPreferencesManager.addSetting("imageAnimationBehavior", {
8374
permission: "browserSettings",
8475
prefNames: ["image.animation_mode"],
@@ -256,7 +247,7 @@ this.browserSettings = class extends ExtensionAPI {
256247
name: "ftpProtocolEnabled",
257248
readOnly: true,
258249
callback() {
259-
return Services.prefs.getBoolPref("network.ftp.enabled");
250+
return false;
260251
},
261252
}),
262253
homepageOverride: getSettingsAPI({

toolkit/components/extensions/schemas/browser_settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
},
5757
"ftpProtocolEnabled": {
5858
"$ref": "types.Setting",
59-
"description": "Returns whether the FTP protocol is enabled. Read-only."
59+
"description": "Returns whether the FTP protocol is enabled. Read-only.",
60+
"deprecated": "FTP support was removed from Firefox in bug 1574475"
6061
},
6162
"homepageOverride": {
6263
"$ref": "types.Setting",

toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,14 @@ add_task(async function test_browser_settings() {
214214
});
215215
}
216216

217-
// Bug 1699222 When the pref is removed, the API needs to be updated to always
218-
// return false. At that time it should be deprecated as well.
219217
extension.sendMessage("get", "ftpProtocolEnabled");
220218
let data = await extension.awaitMessage("settingData");
221-
equal(data.value, Services.prefs.getBoolPref("network.ftp.enabled"));
219+
equal(data.value, false);
220+
equal(
221+
data.levelOfControl,
222+
"not_controllable",
223+
`ftpProtocolEnabled is not controllable.`
224+
);
222225

223226
await testSetting("newTabPosition", "afterCurrent", {
224227
"browser.tabs.insertRelatedAfterCurrent": false,

0 commit comments

Comments
 (0)