Skip to content

Commit

Permalink
feat: Use WebExtension synced storage
Browse files Browse the repository at this point in the history
Extension settings are saved in synced storage.

- Add storage permission to manifest
- Refactor db.js to use storage.sync api via webextension-polyfill
- Refactor most storage usage and browser messaging to use promise format
- Refactor GA storage usage to promises, stop sending settings. Stopped sending settings becaues the data is not really in a reportable format. This may be handled in #1292.
- Refactor DB message-handling to background page. We cannot have more than one message handler taking the same messages; it breaks everything.
- Reduce storage access when using default project
- Add method to retrieve multiple storage values at once

Closes #1296.
  • Loading branch information
tcrammond committed Mar 13, 2019
1 parent 48fd057 commit f936868
Show file tree
Hide file tree
Showing 13 changed files with 991 additions and 987 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ module.exports = {
},
overrides: [
{
files: ['src/scripts/*.js'],
files: ['src/scripts/**/*.js'],
globals: {
db: false,
togglbutton: false,
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"lint-staged": "^8.1.0",
"nanoid": "1.2.6",
"semantic-release": "^15.13.3",
"webextension-polyfill": "^0.4.0",
"webpack": "4.16.3",
"webpack-bugsnag-plugins": "^1.3.0",
"webpack-cli": "3.1.0",
Expand Down
3 changes: 2 additions & 1 deletion src/chrome-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"contextMenus",
"notifications",
"idle",
"tabs"
"tabs",
"storage"
],
"optional_permissions": ["*://*/"],
"externally_connectable": {
Expand Down
3 changes: 2 additions & 1 deletion src/firefox-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"contextMenus",
"notifications",
"idle",
"tabs"
"tabs",
"storage"
],
"optional_permissions": [
"*://*/"
Expand Down
Loading

0 comments on commit f936868

Please sign in to comment.