browsingData.removeLocalStorage()
Clears any local storage and session storage created by websites and extensions.
You can use the removalOptions parameter, which is a browsingData.RemovalOptions object, to:
- clear local and session storage values created after a given time.
- control whether to clear localStorage and sessionStorage values created by web pages or web pages extensions.
Syntax
Parameters
removalOptions-
object. AbrowsingData.RemovalOptionsobject, which can be used to clear localStorage and sessionStorage values stored after a given time, and control whether to clear localStorage and sessionStorage objects created by web pages, or web pages and extensions.
Return value
A Promise that is fulfilled with no arguments when the removal has finished. If any error occurs, the promise is rejected with an error message.
Examples
Remove all local storage:
Browser compatibility
Note:
This API is based on Chromium's chrome.browsingData API.