Skip to content

Commit

Permalink
Convert noteblocks for mozilla/add-ons/webextensions/api folder (part…
Browse files Browse the repository at this point in the history
… 1) (mdn#35118)

Convert noteblocks for mozilla/add-ons/webextensions/api folder

This PR converts the noteblocks for the 'mozilla/add-ons/webextensions/api' folder to GFM syntax, using a [conversion script](https://github.com/queengooborg/mdn-toolkit/blob/main/upgrade-noteblock.js). This is part 1.
  • Loading branch information
queengooborg authored Jul 26, 2024
1 parent 5c000c8 commit b30a10c
Show file tree
Hide file tree
Showing 29 changed files with 90 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ Next, create the "icons" directory inside the "buttons" directory, and save the

!["32 pixel icon of a lined sheet of paper"](page-32.png)

> **Note:** These icons are from the [bitsies!](https://www.iconfinder.com/iconsets/bitsies) iconset created by Recep Kütük.
> [!NOTE]
> These icons are from the [bitsies!](https://www.iconfinder.com/iconsets/bitsies) iconset created by Recep Kütük.
We have two icons so we can use the bigger one in high-density displays. The browser will take care of selecting the best icon for the current display.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ For example, opaque red is `[255, 0, 0, 255]`.

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#type-ColorArray) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#type-ColorArray) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.disable

Disables the browser action for a tab, meaning that it cannot be clicked when that tab is active.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
## Syntax

Expand Down Expand Up @@ -52,7 +53,8 @@ browser.action.onClicked.addListener((tab) => {

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-disable) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-disable) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.enable

Enables the browser action for a tab. By default, browser actions are enabled for all tabs.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
## Syntax

Expand Down Expand Up @@ -44,7 +45,8 @@ browser.action.onClicked.addListener(() => {

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-enable) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-enable) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.getBadgeBackgroundColor

Gets the background color of the browser action's badge.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

Expand Down Expand Up @@ -63,7 +64,8 @@ browser.action.getBadgeBackgroundColor({}).then(onGot, onFailure);

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getBadgeBackgroundColor) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getBadgeBackgroundColor) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.getBadgeText

Gets the browser action's badge text.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

Expand Down Expand Up @@ -60,7 +61,8 @@ gettingBadgeText.then(gotBadgeText);

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getBadgeText) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getBadgeText) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.getBadgeTextColor

Gets the text color for the browser action's badge.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
In Firefox, unless the badge text color is explicitly set using {{WebExtAPIRef("action.setBadgeTextColor()")}}, the badge text color is automatically set to black or white so as to maximize contrast with the specified badge background color. For example, if you set the badge background color to white, the default badge text color is set to black, and vice versa.

Expand Down Expand Up @@ -67,7 +68,8 @@ browser.action.getBadgeTextColor({}).then(onGot, onFailure);

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getBadgeBackgroundColor) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getBadgeBackgroundColor) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.getPopup

Gets the HTML document set as the popup for this browser action.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

Expand Down Expand Up @@ -60,7 +61,8 @@ gettingPopup.then(gotPopup);

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getPopup) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getPopup) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.getTitle

Gets the browser action's title.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
Just as you can set the title on a per-tab basis using {{WebExtAPIRef("action.setTitle()")}}, so you can retrieve a tab-specific title by passing the tab's ID into this function.

Expand Down Expand Up @@ -68,7 +69,8 @@ browser.action.onClicked.addListener(() => {

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getTitle) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getTitle) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.getUserSettings

Gets the user-specified settings for the browser action.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

Expand Down Expand Up @@ -57,7 +58,8 @@ gettingUserSettings.then(gotSettings);

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getUserSettings) API.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-getUserSettings) API.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ An [`ImageData`](/en-US/docs/Web/API/ImageData) object.

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#type-ImageDataType) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#type-ImageDataType) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
6 changes: 4 additions & 2 deletions files/en-us/mozilla/add-ons/webextensions/api/action/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action

Read and modify attributes of and listen to clicks on the browser toolbar button defined with the [`action`](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/action) manifest key.

> **Note:** This API is available in Manifest V3 or higher. It replaces the Manifest V2 APIs {{WebExtAPIRef("browserAction")}} and, in Chrome and Safari, {{WebExtAPIRef("pageAction")}}.
> [!NOTE]
> This API is available in Manifest V3 or higher. It replaces the Manifest V2 APIs {{WebExtAPIRef("browserAction")}} and, in Chrome and Safari, {{WebExtAPIRef("pageAction")}}.
A [browser action](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Toolbar_button) is a button in the browser's toolbar.

Expand Down Expand Up @@ -77,7 +78,8 @@ With the `action` API, you can:

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/) API. This documentation is derived from [`action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/) API. This documentation is derived from [`action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.isEnabled

Returns `true` if the browser action is enabled.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.onClicked

Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
To define a right-click action, use the [`contextMenus`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus) API with the "browser_action" [context type](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/menus/ContextType).

Expand Down Expand Up @@ -68,7 +69,8 @@ browser.action.onClicked.addListener((tab) => {

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#event-onClicked) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#event-onClicked) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.openPopup

Open the browser action's popup.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
In stable versions of Firefox, you can only call this function from inside the handler for a [user action](/en-US/docs/Mozilla/Add-ons/WebExtensions/User_actions). See [Browser compatibility](#browser_compatibility) for details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.setBadgeBackgroundColor

Sets the background color for the badge. Tabs without a specific badge background color will inherit the global badge background color, which defaults to `[217, 0, 0, 255]` in Firefox.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
In Firefox, unless the badge text color is explicitly set using {{WebExtAPIRef("action.setBadgeTextColor()")}}, then the badge text color iw automatically set to black or white to maximize contrast with the specified badge background color. For example, if you set the badge background color to white, the default badge text color is set to black, and vice versa.

Expand Down Expand Up @@ -82,7 +83,8 @@ browser.action.onClicked.addListener((tab) => {

The default color in Firefox is: `[217, 0, 0, 255]`.

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-setBadgeBackgroundColor) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-setBadgeBackgroundColor) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.setBadgeText

Sets the badge text for the browser action. The badge is displayed on top of the icon.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
Tabs without a specific badge text will inherit the global badge text, which is `""` by default.

Expand Down Expand Up @@ -69,7 +70,8 @@ browser.action.onClicked.addListener(increment);

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-setBadgeText) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-setBadgeText) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ browser-compat: webextensions.api.action.setBadgeTextColor

Sets the text color for the browser action's badge. Tabs without a specific badge text color will inherit the global badge text color.

> **Note:** This API is available in Manifest V3 or higher.
> [!NOTE]
> This API is available in Manifest V3 or higher.
## Syntax

Expand Down Expand Up @@ -76,7 +77,8 @@ browser.action.onClicked.addListener((tab) => {

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-setBadgeBackgroundColor) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
> [!NOTE]
> This API is based on Chromium's [`chrome.action`](https://developer.chrome.com/docs/extensions/reference/action/#method-setBadgeBackgroundColor) API. This documentation is derived from [`browser_action.json`](https://chromium.googlesource.com/chromium/src/+/master/chrome/common/extensions/api/browser_action.json) in the Chromium code.
<!--
// Copyright 2015 The Chromium Authors. All rights reserved.
Expand Down
Loading

0 comments on commit b30a10c

Please sign in to comment.