I've written a Chrome Extension for my library. It uses chrome.storage.local
to cache things.
Does anyone know how to drop the cache for testing purposes? I can't really test things anymore as all the data is now in cache. I'd like to drop it and make sure it gets repopulated correctly, etc. How do I do that?
I tried "Refresh"-ing the extension but that did nothing. Removing and adding the extension doesn't appear to clean cache either.
sync , the stored data will automatically be synced to any Chrome browser that the user is logged into, provided the user has sync enabled. When Chrome is offline, Chrome stores the data locally. The next time the browser is online, Chrome syncs the data. Even if a user disables syncing, storage.
With the extension's background page open, just go to the developer tools by pressing F12, then go to the Application tab. In the Storage section expand Local Storage. After that, you'll see all your browser's local storage there.
Google Chrome records Web storage data in a SQLite file in the user's profile. The subfolder containing this file is " \AppData\Local\Google\Chrome\User Data\Default\Local Storage " on Windows, and " ~/Library/Application Support/Google/Chrome/Default/Local Storage " on macOS.
Use chrome.storage.local.clear() and chrome.storage.sync.clear()
The API is asynchronous so to do subsequent actions to the storage, use a callback:
chrome.storage.local.clear(function() { var error = chrome.runtime.lastError; if (error) { console.error(error); } // do something more }); chrome.storage.sync.clear(); // callback is optional
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With