For reading and writing of settings.
Promise-based API taking into account defaults values.
Also drop unused loadSettings callback in options page.
Details
- Reviewers
fvogt ognarb - Group Reviewers
Plasma - Commits
- R856:64d6bab15fe6: Add SettingsUtils utility class
- Settings page loads and write settings fine
- Content script loads settings fine
- Extension script loads settings fine and sends them to the host
- Error propagates fine (e.g. reloaded extension while settings page was open and then tried to save settings)
Probably needs some Firefox ESR 60 testing to see whether it can deal with the class stuff...
Diff Detail
- Repository
- R856 Plasma Browser Integration
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Probably needs some Firefox ESR 60 testing to see whether it can deal with the class stuff...
I can try if you'd like.
extension/options.js | ||
---|---|---|
130–131 | This can be caught in SettingsUtils now | |
extension/utils.js | ||
20 | Wow, ES6 does indeed not support static members... | |
51 | So on FF nothing using onChanged will actually work? |
That would be appreciated.
extension/utils.js | ||
---|---|---|
20 | Yeah... :/ | |
51 | Yes. The settings page actually sends a signal when the user changes something, which I might be able to catch... but this is for a later revision, I don't actually use the onChanged stuff just yet. The plan is mostly meant for some Schmankerl to have e.g. media controls turn on/off live, nothing essential. |
+1 but I couldn't test it (changed my distro recently and can't get pbi to work yet).
The js class is available in firefox since Firefox 45 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Browser_compatibility so it should work in firefox esr