BandcampEnhancementSuite icon indicating copy to clipboard operation
BandcampEnhancementSuite copied to clipboard

Application Preferences

Open sabjorn opened this issue 4 years ago • 6 comments

It would be nice to be able to selective enable/disable features. This could then be extended for each feature to have some fine grained control (for example: configuring step size for jump forward/back audio feature; and/or changing the keybindings for the keyboard controls).

Ideally this would be a framework that is easily extended for each feature (each feature script talks to the background.js and acquires all the information it needs when it loads). Some sort of config struct could be used to unify the front/back end parameters.

Visually, nested menus would be good but to start off maybe just an omni list of controls?

sabjorn avatar Jul 24 '20 16:07 sabjorn

➕ 1 for simplicity to start. A settings page can take up as much room as it needs to.

I don't think proxying through background.js is necessary - if I recall, the typical pattern for this is setting a default settings object in localstorage then accessing it whenever needed, as localStorage is shared in the whole extension.

Some complexity that gets introduced here is planning upgrades/migrations once you define a schema for the settings object. For this reason I'd recommend keeping a very simple structure, like {settings: []} and keeping all of the settings as un-nested as possible.

emcniece avatar Aug 03 '20 18:08 emcniece

Isn't local storage is per domain?

sabjorn avatar Aug 03 '20 19:08 sabjorn

Isn't local storage is per domain?

Yes, and I think the domain for your extension is something like chrome://extensions/?id=emgkbcgolkdoaaalacdocflfjccadjeo

emcniece avatar May 16 '21 16:05 emcniece

@emcniece only for background scripts. So, yes, this could be implemented by having local storage connected to in a background script (like IDB is being used). However, I already have IDB stuff working and it doesn't have the storage limitations of local storage.

sabjorn avatar May 16 '21 16:05 sabjorn

it probably is time to start thinking about having a real configuration page that you can load rather than the little popup that you get when you click on the BES icon.

sabjorn avatar Feb 26 '22 20:02 sabjorn

it is possible to have an "options" page which becomes a right-click selectable element on the extension icon:

https://developer.chrome.com/docs/extensions/mv3/getstarted/#options

sabjorn avatar Mar 03 '22 01:03 sabjorn