Use modern browser API
Created by: felixfbecker
- Removes all uses of
chrome
API and replaces it with thebrowser
API, which is much nicer as it uses Promises. - Adds custom types for WebExtensions because existing ones were largely incorrect. Might contribute to DT.
- Removes the src/browser API wrapper, which was unpredictable and inconsistent.
- Removes the storage wrapper and replaces it with a simpler wrapper that does nothing but add type safety.
- As part of that, removes migrations. They were really hard to reason about and trivial to do ad-hoc when we need them. All migrations had been in there for a long time.
- Also now all storage items are correctly typed as potentially
undefined
- Changes scripts/background.ts to use async/await and make the content/background script RPC more type safe (replace switch statement with dispatcher).
Closes #3200 Closes #3005
Test Plan
Code Hosts
-
GitHub -
GitHub Enterprise -
Refined GitHub -
Phabricator -
Phabricator integration ⚠ ️ -
Bitbucket -
Gitlab
Browsers
-
Chrome -
Firefox