docs.rodeo

MDN Web Docs mirror

browsingData.removeLocalStorage()

{{AddonSidebar}} 

Clears any local storage created by websites.

You can use the removalOptions parameter, which is a {{WebExtAPIRef("browsingData.RemovalOptions")}}  object, to:

This is an asynchronous function that returns a Promise.

Syntax

let removing = browser.browsingData.removeLocalStorage(
  removalOptions            // RemovalOptions object
)

Parameters

Return value

A Promise that will be fulfilled with no arguments when the removal has finished. If any error occurs, the promise will be rejected with an error message.

Examples

Remove all local storage:

function onRemoved() {
  console.log("removed");
}

function onError(error) {
  console.error(error);
}

browser.browsingData.removeLocalStorage({}).then(onRemoved, onError);

Browser compatibility

{{Compat}} 

{{WebExtExamples}} 

[!NOTE] This API is based on Chromium’s chrome.browsingData API.

In this article

View on MDN