0

I have stored a colour value in my firefox extension using this code

function saveOptions(e) {
  browser.storage.sync.set({
    colour: document.querySelector("#colour").value
  });
  e.preventDefault();
}

This works fine but to retest the extension I want to completely remove all the data previously set by the extension and then wants to freshly test the extension.How can we remove stored values in firefox extension?

EDIT:

I am following this project and delete All using inspect>Storage>Extension Storage does not work.

Eka
  • 14,170
  • 38
  • 128
  • 212
  • You can use the documentation on MDN for any extension-specific API: [link](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/sync). – wOxxOm Jun 27 '21 at 08:38

2 Answers2

1

In Firefox you can put in about:debugging in the URL which will bring up the list of addons you have installed. If you inspect the addon you'll see an option to view the Extension Storage. You can "delete all" from there.

Andy
  • 61,948
  • 13
  • 68
  • 95
  • I already did that, went to `inspect>Storage>Extension Storage` but it shows `No data present for selected host`. So nothing to delete but I can still access the data from my extension. – Eka Jun 27 '21 at 09:48
0

Try using browser.storage.sync.clear()

tst
  • 479
  • 4
  • 7