Skip to content

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mellash
Copy link

@mellash mellash commented Feb 16, 2025

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

@mellash mellash requested a review from a team as a code owner February 16, 2025 07:16
@mellash mellash requested review from jpmedley and removed request for a team February 16, 2025 07:16
@github-actions github-actions bot added Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed labels Feb 16, 2025
@mellash mellash mentioned this pull request Feb 17, 2025
@Josh-Cena Josh-Cena requested review from rebloor and removed request for jpmedley March 2, 2025 00:07
@@ -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(
Copy link
Contributor

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))

Suggested change
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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let updatedStaticRules = await browser.declarativeNetRequest.updateStaticRules(
let staticRulesUpdated = browser.declarativeNetRequest.updateStaticRules(

@bsmth bsmth added the awaiting response Awaiting for author to address review/feedback label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Awaiting for author to address review/feedback Content:WebExt WebExtensions docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants