1. Mozilla
  2. Add-ons
  3. Browser extensions
  4. JavaScript APIs
  5. browserSettings
  6. browserSettings.cacheEnabled

browserSettings.cacheEnabled

A BrowserSetting object that can be used to globally enable or disable the browser cache.

The underlying value is a boolean.

Examples

Getting the current value of this setting:

js
function logResult(result) {
 console.log(`Current value: ${result.value}`);
 console.log(`Current level of control: ${result.levelOfControl}`);
}
browser.browserSettings.cacheEnabled.get({}).then(logResult);

Disabling the browser cache:

js
function logResult(result) {
 console.log(`Setting was modified: ${result}`);
}
browser.browserSettings.cacheEnabled.set({ value: false }).then(logResult);

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.

AltStyle によって変換されたページ (->オリジナル) /