browserSettings.ftpProtocolEnabled
浏览器兼容性
BCD tables only load in the browser
示例
切换设置:
js
function toggleAllowFtp() {
function toggle(current) {
console.log(`当前值:${current.value}`);
browser.browserSettings.ftpProtocolEnabled.set({ value: !current.value });
}
browser.browserSettings.ftpProtocolEnabled.get({}).then(toggle);
}
browser.browserAction.onClicked.addListener(() => {
toggleAllowFtp();
});