0

I have a checkbox on the popup of the extension and I want to save the status of the checkbox for every page.

I've tried using browser.storage.local but it will be shared within different tabs that have the extension running.

How do you save the sate of a checkbox in popup.html that is unique for every opened tabs?

1 Answers1

0

Every open tab, will be opened to a different page, so you can use window.location of each open tab, and then you can use Chrome.Storage to save a key pair Object, of the Checkbox State, and window.location.

Have your popup.js include the chrome.storage.get to retrieve the variable from local storage at the top of the script. Include popup.js in your popup.html.

You would need to have some type of IF/ELSE statement to say, if window.location is equal to what's in the Chrome.storage.get, then checkbox state is...

Jason Owens
  • 525
  • 2
  • 6
  • 21