aprzn123 / TheThirdCan

A browser extension designed to improve https://twocansandstring.com
MIT License
7 stars 4 forks source link

expose settings/config via sessionstorage #4

Closed HumanoidSandvichDispenser closed 1 year ago

HumanoidSandvichDispenser commented 1 year ago

This PR exposes the user's current settings/configuration through localStorage, which allows injected scripts to read what features the user enabled.

This would be useful in #3/#1 where the "skip for now" button should also confirm skipping the question for now if the user has skip confirmation enabled. It also allows the textSkipConfirm.js and alwaysSkipConfirm.js scripts to be combined in one file.

HumanoidSandvichDispenser commented 1 year ago

I changed the variable name. Is it ready now?

aprzn123 commented 1 year ago

Just realized I misunderstood your code lol. A couple potential changes now that I understand what it is actually doing:

  1. have you considered using sessionStorage instead of localStorage, since this doesn't need to be persistent?
  2. I had thought that it was ttcSettings that was going into a public namespace; since it's actually "cfg", I think that is probably the one that needs a more specific name. Once these are addressed, I'll merge it :)