Use promises for extension API calls in release-2019-1
Background
In #323 (closed) we made sure that none of the existing code (i.e. in master) passes callbacks anymore to extension API calls to stay compatible and allow for upcoming changes in WebExt. We also need to make this change to any new code that will be introduced with release-2019-1.
What to change
In release-2019-1: Where possible use Promises instead of callbacks when using the browser.*
or chrome.*
APIs.
This includes the following changes:
- Update mock files:
- ext/content.js
- Update UI files:
- js/issue-reporter-report.js
- Fix regression as described in this comment.
Since APIs relating to optional permissions (i.e. browser.contentSettings.*
and browser.management.*
) are injected at runtime, make sure that our polyfill handles those properly.
Integration notes
Add asynchronous browser APIs to polyfill.js:
contentSettings.cookies.get
contentSettings.javascript.get
management.getAll
Hints for testers
- #152 (closed) should continue to work as defined in spec for all supported browsers.
- For Chinese users: Weibo link in Help tab in desktop settings page should work.
Edited by Thomas Greiner