-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Add await keyword to some of the examples #38177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -12,7 +12,7 @@ Configures whether the action count for tabs is displayed as the extension actio | |||
## Syntax | |||
|
|||
```js-nolint | |||
let count = browser.declarativeNetRequest.setExtensionActionOptions( | |||
let count = await browser.declarativeNetRequest.setExtensionActionOptions( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where the promise returns with no arguments, the more common approach in the docs is to omit await. (see #38073 (comment))
let count = await browser.declarativeNetRequest.setExtensionActionOptions( | |
let settingCount = browser.declarativeNetRequest.setExtensionActionOptions( |
@@ -23,7 +23,7 @@ Modifies the set of dynamic rules for the extension. The rules with IDs listed i | |||
## Syntax | |||
|
|||
```js-nolint | |||
let updatedRules = browser.declarativeNetRequest.updateDynamicRules( | |||
let updatedRules = await browser.declarativeNetRequest.updateDynamicRules( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let updatedRules = await browser.declarativeNetRequest.updateDynamicRules( | |
let rulesUpdated = browser.declarativeNetRequest.updateDynamicRules( |
@@ -19,7 +19,7 @@ Modifies the set of session-scoped rules for the extension. The rules with IDs l | |||
## Syntax | |||
|
|||
```js-nolint | |||
let updatedRuleset = browser.declarativeNetRequest.updateSessionRules( | |||
let updatedRuleset = await browser.declarativeNetRequest.updateSessionRules( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let updatedRuleset = await browser.declarativeNetRequest.updateSessionRules( | |
let rulesetUpsated = browser.declarativeNetRequest.updateSessionRules( |
@@ -14,7 +14,7 @@ Rules can be enabled and disabled while the ruleset containing them is disabled. | |||
## Syntax | |||
|
|||
```js-nolint | |||
let updatedStaticRules = browser.declarativeNetRequest.updateStaticRules( | |||
let updatedStaticRules = await browser.declarativeNetRequest.updateStaticRules( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let updatedStaticRules = await browser.declarativeNetRequest.updateStaticRules( | |
let staticRulesUpdated = browser.declarativeNetRequest.updateStaticRules( |
Description
This PR is a partial fix to the issue issues#37866. I was planning to review the Browser extensions section and add small fix(content) to it instead of making one huge PR.
Motivation
Like I said before, I honestly love MDN for making information free and open to anyone, and decided to contribute by fixing some of the issues :)
Additional details
issues#37866
Related issues and pull requests
pull#3818