Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cannot be negative numbers.
* When offline Glean will not attempt to install glean_parser.
* [#1178](https://github.com/mozilla/glean.js/pull/1178): Enable running the `glean` command with as many or as little arguments as wanted.
* Previously the command could only be run with 3 commands, even though all glean_parser commands would have been valid commands for the `glean` CLI.
* [#1210](https://github.com/mozilla/glean.js/pull/1210): Show comprehensive error message when missing `storage` permissions for Glean on web extensions.

# v0.31.0 (2022-01-25)

Expand Down
9 changes: 9 additions & 0 deletions glean/src/platform/browser/webext/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ class WebExtStore implements Store {
the webextension-polyfill peer dependency. To do so, run \`npm i webextension-polyfill\`.`
);
}

if (typeof browser.storage.local === "undefined") {
throw Error(
`Unable to access web extension storage.
This is probably happening due to missing \`storage\` API permissions.
Make sure this permission was set on the manifest.json file.`
);
}

this.store = browser.storage.local;
this.rootKey = rootKey;
this.logTag = `${LOG_TAG}.${rootKey}`;
Expand Down