content
content copied to clipboard
Refactor Web Extensions Permissions API examples to async/await
Description
Refactoring the examples in Web Extensions Permissions API from .then() syntax to async/await syntax.
Motivation
We are moving towards having the Web Extensions examples using that syntax and as I'm writing a blog post for the add-ons community blog where I use these examples, it came up that this would be a good moment to refactor them in MDN and then use the same format in the blog post.
For example, tabs API and background_scripts are already refactored.
Additional details
Related issues and pull requests
Preview URLs
- /en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions/contains
- /en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions/getAll
- /en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions/remove
- /en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions/request
(this comment was updated 2022-11-07 12:56:48.569094)
Thanks @Hamatti and @rebloor, merging 🙌🏻