Back to Content

browserSettings.ftpProtocolEnabled

files/en-us/mozilla/add-ons/webextensions/api/browsersettings/ftpprotocolenabled/index.md

latest677 B
Original Source

A {{WebExtAPIRef("types.BrowserSetting", "BrowserSetting")}} object that determines whether the FTP protocol is enabled in the browser.

The underlying value is a boolean.

[!NOTE] From Firefox version 88 this setting is read-only.

Examples

Toggle the setting:

js
function toggleAllowFtp() {
  function toggle(current) {
    console.log(`Current value: ${current.value}`);
    browser.browserSettings.ftpProtocolEnabled.set({ value: !current.value });
  }

  browser.browserSettings.ftpProtocolEnabled.get({}).then(toggle);
}

browser.browserAction.onClicked.addListener(() => {
  toggleAllowFtp();
});

{{WebExtExamples}}

Browser compatibility

{{Compat}}