D24165: Add SettingsUtil utility class

Fabian Vogt noreply at phabricator.kde.org
Mon Sep 23 18:04:14 BST 2019


fvogt added a comment.


  > Probably needs some Firefox ESR 60 testing to see whether it can deal with the class stuff...
  
  I can try if you'd like.

INLINE COMMENTS

> options.js:137
>          });
>      // When the extension is reloaded, any call to extension APIs throws
>      } catch (e) {

This can be caught in SettingsUtils now

> utils.js:19
> +class SettingsUtils {
> +    static storage() {
> +        return (IS_FIREFOX ? chrome.storage.local : chrome.storage.sync);

Wow, ES6 does indeed not support static members...

> utils.js:50
> +    static onChanged() {
> +        // Firefox doesn't support change listeners, return a fake one
> +        let changeListener = SettingsUtils.storage().onChanged;

So on FF nothing using `onChanged` will actually work?

REPOSITORY
  R856 Plasma Browser Integration

REVISION DETAIL
  https://phabricator.kde.org/D24165

To: broulik, #plasma, fvogt, ognarb
Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20190923/3d948093/attachment-0001.html>


More information about the Plasma-devel mailing list