browserSettings.overrideDocumentColors 编辑

A BrowserSetting object whose underlying value is a string.

Firefox enables the user to set their own colors for document backgrounds and text. By default these values are only applied when a high-contrast theme is selected (a high-contrast theme is a feature of some operating system UIs that increases the contrast for improved accessibility). However, users can also choose to apply these colors always or never. This browser setting exposes that preference.

Its underlying value is a string that may take any one of the following values:

  • "high-contrast-only": Apply the user's choices only when a high-contrast theme is selected. This is the default.
  • "never":  Never apply the user's choices.
  • "always": Always apply the user's choices.

Browser compatibility

BCD tables only load in the browser

Examples

Set the setting to "always":

function logResult(result) {
  console.log(`Setting was modified: ${result}`);
}

browser.browserSettings.overrideDocumentColors.set({value: "always"}).
  then(logResult);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:95 次

字数:1781

最后编辑:6 年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文