remove-unused-storage.js 389 B

123456789101112131415
  1. /* global chromeLocal */// storage-util.js
  2. 'use strict';
  3. // Removing unused stuff from storage on extension update
  4. // TODO: delete this by the middle of 2021
  5. try {
  6. localStorage.clear();
  7. } catch (e) {}
  8. setTimeout(async () => {
  9. const del = Object.keys(await chromeLocal.get())
  10. .filter(key => key.startsWith('usoSearchCache'));
  11. if (del.length) chromeLocal.remove(del);
  12. }, 15e3);