Skip to content

Commit

Permalink
master to main (#14804)
Browse files Browse the repository at this point in the history
  • Loading branch information
OnkarRuikar authored Apr 8, 2022
1 parent cd0de41 commit cfc412a
Show file tree
Hide file tree
Showing 37 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ For details on how to create icons to use with your browser action, see [Iconogr

The [`webextensions-examples`](https://github.com/mdn/webextensions-examples) repository on GitHub contains two examples of extensions that implement browser actions:

- [bookmark-it](https://github.com/mdn/webextensions-examples/blob/master/bookmark-it/) uses a browser action without a popup
- [bookmark-it](https://github.com/mdn/webextensions-examples/tree/master/bookmark-it) uses a browser action without a popup
- [beastify](https://github.com/mdn/webextensions-examples/tree/master/beastify) uses a browser action with a popup
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ For details on how to create icons to use with your developer tools panel, see [

## Examples

The [webextensions-examples](https://github.com/mdn/webextensions-examples) repository on GitHub includes the [devtools-panels](https://github.com/mdn/webextensions-examples/blob/master/devtools-panels/) example which implements a devtools panel.
The [webextensions-examples](https://github.com/mdn/webextensions-examples) repository on GitHub includes the [devtools-panels](https://github.com/mdn/webextensions-examples/tree/master/devtools-panels) example which implements a devtools panel.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Note that all paths given are relative to manifest.json itself.

The extension should have an icon. This will be shown next to the extension's listing in the Add-ons Manager (you can open this by visiting the URL "about:addons"). Our manifest.json promised that we would have an icon for the toolbar at "icons/beasts-48.png".

Create the "icons" directory and save an icon there named "beasts-48.png". You could use [the one from our example](https://github.com/mdn/webextensions-examples/raw/master/beastify/icons/beasts-48.png), which is taken from the [Aha-Soft's Free Retina iconset](https://www.iconfinder.com/iconsets/free-retina-icon-set), and used under the terms of its [license](https://www.aha-soft.com/free-icons/free-retina-icon-set/).
Create the "icons" directory and save an icon there named "beasts-48.png". You could use [the one from our example](https://raw.githubusercontent.com/mdn/webextensions-examples/master/beastify/icons/beasts-48.png), which is taken from the [Aha-Soft's Free Retina iconset](https://www.iconfinder.com/iconsets/free-retina-icon-set), and used under the terms of its [license](https://www.aha-soft.com/free-icons/free-retina-icon-set/).

If you choose to supply your own icon, It should be 48x48 pixels. You could also supply a 96x96 pixel icon, for high-resolution displays, and if you do this it will be specified as the `96` property of the `icons` object in manifest.json:

Expand All @@ -116,7 +116,7 @@ If you choose to supply your own icon, It should be 48x48 pixels. You could also

The toolbar button also needs an icon, and our manifest.json promised that we would have an icon for the toolbar at "icons/beasts-32.png".

Save an icon named "beasts-32.png" in the "icons" directory. You could use [the one from our example](https://github.com/mdn/webextensions-examples/raw/master/beastify/icons/beasts-32.png), which is taken from the [IconBeast Lite icon set](http://www.iconbeast.com/free) and used under the terms of its [license](http://www.iconbeast.com/faq/).
Save an icon named "beasts-32.png" in the "icons" directory. You could use [the one from our example](https://raw.githubusercontent.com/mdn/webextensions-examples/master/beastify/icons/beasts-32.png), which is taken from the [IconBeast Lite icon set](http://www.iconbeast.com/free) and used under the terms of its [license](http://www.iconbeast.com/faq/).

If you don't supply a popup, then a click event is dispatched to your extension when the user clicks the button. If you do supply a popup, the click event is not dispatched, but instead, the popup is opened. We want a popup, so let's create that next.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/element/shadowroot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ shadow root was attached with its {{DOMxRef("ShadowRoot.mode", "mode")}} set to

The following snippets are taken from our [life-cycle-callbacks](https://github.com/mdn/web-components-examples/tree/master/life-cycle-callbacks)
example ([see it live
also](https://mdn.github.io/web-components-examples/life-cycle-callbacks)), which creates an element that displays a square of a size and color
also](https://mdn.github.io/web-components-examples/life-cycle-callbacks/)), which creates an element that displays a square of a size and color
specified in the element's attributes.

Inside the `<custom-square>` element's class definition we include
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbcursor/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ IDBObjectStore {autoIncrement: false, transaction: IDBTransaction, indexNames: D
The cursor does not require us to select the data based
on a key; we can just grab all of it. Also note that in each iteration of the loop,
you can grab data from the current record under the cursor object using `cursor.value.foo`. For a complete working example, see our [IDBCursor
example](https://github.com/mdn/indexeddb-examples/blob/master/idbcursor) ([view example live](https://mdn.github.io/indexeddb-examples/idbcursor/).)
example](https://github.com/mdn/indexeddb-examples/tree/master/idbcursor) ([view example live](https://mdn.github.io/indexeddb-examples/idbcursor/).)

```js
function displayData() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/count/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ returns.
Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex).)
example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/get/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ the console when its success callback returns.
Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex).)
example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/getkey/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ is logged to the console when its success callback returns.
Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex).)
example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Inherits from: [EventTarget](/en-US/docs/Web/API/EventTarget)

In the following example we open a transaction and an object store, then get the index `lName` from a simple contacts database. We then open a basic cursor on the index using {{domxref("IDBIndex.openCursor")}} — this works the same as opening a cursor directly on an `ObjectStore` using {{domxref("IDBObjectStore.openCursor")}} except that the returned records are sorted based on the index, not the primary key.

Finally, we iterate through each record, and insert the data into an HTML table. For a complete working example, see our [IndexedDB-examples demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the example live](https://mdn.github.io/indexeddb-examples/idbindex).)
Finally, we iterate through each record, and insert the data into an HTML table. For a complete working example, see our [IndexedDB-examples demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/keypath/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ as `lName`.
Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex).)
example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/multientry/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ as `false`.
Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex).)
example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/name/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The name of the index is logged to the console: it should be returned as
Finally, we iterate through each record, inserting the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex)).
example live](https://mdn.github.io/indexeddb-examples/idbindex/)).

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/objectstore/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ IDBObjectStore { name: "contactsList", keyPath: "id", indexNames: DOMStringList[
Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex).)
example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/opencursor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ except that the returned records are sorted based on the index, not the primary
Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex).)
example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbindex/unique/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ as `false`.
Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IndexedDB-examples
demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the
example live](https://mdn.github.io/indexeddb-examples/idbindex).)
example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/idbobjectstore/index/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ except that the returned records are sorted based on the index, not the primary

Finally, we iterate through each record, and insert the data into an HTML table. For a
complete working example, see our [IDBIndex example
in IndexedDB-examples demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the example live](https://mdn.github.io/indexeddb-examples/idbindex).)
in IndexedDB-examples demo repo](https://github.com/mdn/indexeddb-examples/tree/master/idbindex) ([View the example live](https://mdn.github.io/indexeddb-examples/idbindex/).)

```js
function displayDataByIndex() {
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/mediaerror/message/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ handler outputs a message to a box onscreen describing the error, including both
`code` and the `message`.

Only the relevant parts of the code are displayed; you can [see the
complete source code here](https://github.com/mdn/dom-examples/blob/master/media/mediaerror/).
complete source code here](https://github.com/mdn/dom-examples/tree/master/media/mediaerror).

The example creates an {{HTMLElement("audio")}} element and lets the user assign either
a valid music file to it, or a link to a file which doesn't exist. This lets us see the
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/shadowroot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ You can retrieve a reference to an element's shadow root using its {{domxref("El

## Examples

The following snippets are taken from our [life-cycle-callbacks](https://github.com/mdn/web-components-examples/tree/master/life-cycle-callbacks) example ([see it live also](https://mdn.github.io/web-components-examples/life-cycle-callbacks)), which creates an element that displays a square of a size and color specified in the element's attributes.
The following snippets are taken from our [life-cycle-callbacks](https://github.com/mdn/web-components-examples/tree/master/life-cycle-callbacks) example ([see it live also](https://mdn.github.io/web-components-examples/life-cycle-callbacks/)), which creates an element that displays a square of a size and color specified in the element's attributes.

Inside the `<custom-square>` element's class definition we include some life cycle callbacks that make a call to an external function, `updateStyle()`, which actually applies the size and color to the element. You'll see that we are passing it `this` (the custom element itself) as a parameter.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Our [chat server](https://github.com/mdn/samples-server/tree/master/s/websocket-

To allow the server to support signaling and ICE negotiation, we need to update the code. We'll have to allow directing messages to one specific user instead of broadcasting to all connected users, and ensure unrecognized message types are passed through and delivered, without the server needing to know what they are. This lets us send signaling messages using this same server, instead of needing a separate server.

Let's take a look at changes we need to make to the chat server to support WebRTC signaling. This is in the file [`chatserver.js`](https://github.com/mdn/samples-server/tree/master/s/webrtc-from-chat/chatserver.js).
Let's take a look at changes we need to make to the chat server to support WebRTC signaling. This is in the file [`chatserver.js`](https://github.com/mdn/samples-server/blob/master/s/webrtc-from-chat/chatserver.js).

First up is the addition of the function `sendToOneUser()`. As the name suggests, this sends a stringified JSON message to a particular username.

Expand Down Expand Up @@ -181,7 +181,7 @@ The HTML for our client needs a location for video to be presented. This require
</div>
```

The page structure defined here is using {{HTMLElement("div")}} elements, giving us full control over the page layout by enabling the use of CSS. We'll skip layout detail in this guide, but [take a look at the CSS](https://github.com/mdn/samples-server/tree/master/s/webrtc-from-chat/chat.css) on GitHub to see how we handled it. Take note of the two {{HTMLElement("video")}} elements, one for your self-view, one for the connection, and the {{HTMLElement("button")}} element.
The page structure defined here is using {{HTMLElement("div")}} elements, giving us full control over the page layout by enabling the use of CSS. We'll skip layout detail in this guide, but [take a look at the CSS](https://github.com/mdn/samples-server/blob/master/s/webrtc-from-chat/chat.css) on GitHub to see how we handled it. Take note of the two {{HTMLElement("video")}} elements, one for your self-view, one for the connection, and the {{HTMLElement("button")}} element.

The `<video>` element with the `id` "`received_video`" will present video received from the connected user. We specify the `autoplay` attribute, ensuring once the video starts arriving, it immediately plays. This removes any need to explicitly handle playback in our code. The "`local_video`" `<video>` element presents a preview of the user's camera; specifying the `muted` attribute, as we don't need to hear local audio in this preview panel.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In this example, we will open an {{domxref("RTCDataChannel")}} connection linkin

## The HTML

First, let's take a quick look at the [HTML that's needed](https://github.com/mdn/samples-server/tree/master/s/webrtc-simple-datachannel/index.html). There's nothing incredibly complicated here. First, we have a couple of buttons for establishing and closing the connection:
First, let's take a quick look at the [HTML that's needed](https://github.com/mdn/samples-server/blob/master/s/webrtc-simple-datachannel/index.html). There's nothing incredibly complicated here. First, we have a couple of buttons for establishing and closing the connection:

```html
<button id="connectButton" name="connectButton" class="buttonleft">
Expand Down Expand Up @@ -51,7 +51,7 @@ Finally, there's the little box into which we'll insert the messages. This {{HTM

## The JavaScript code

While you can just [look at the code itself on GitHub](https://github.com/mdn/samples-server/tree/master/s/webrtc-simple-datachannel/main.js), below we'll review the parts of the code that do the heavy lifting.
While you can just [look at the code itself on GitHub](https://github.com/mdn/samples-server/blob/master/s/webrtc-simple-datachannel/main.js), below we'll review the parts of the code that do the heavy lifting.

The WebRTC API makes heavy use of {{jsxref("Promise")}}s. They make it very easy to chain the steps of the connection process together; if you haven't already read up on this functionality of [ECMAScript 2015](/en-US/docs/Archive/Web/JavaScript/New_in_JavaScript/ECMAScript_2015_support_in_Mozilla), you should read up on them. Similarly, this example uses [arrow functions](/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions) to simplify syntax.

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/css/@counter-style/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,4 @@ The [Counter styles converter](https://r12a.github.io/app-counters/) pulls from
- {{Cssxref("list-style")}}, {{Cssxref("list-style-image")}}, {{Cssxref("list-style-position")}}, {{Cssxref("list-style-type")}}
- {{cssxref("symbols", "symbols()")}}, the functional notation creating anonymous counter styles.
- CSS {{Cssxref("counter", "counter()")}} and {{Cssxref("counters", "counters()")}} functions
- [Counter style demo](https://mdn.github.io/css-examples/counter-style-demo/) ([code](https://github.com/mdn/css-examples/tree/master/counter-style-demo))
- [Counter style demo](https://mdn.github.io/css-examples/counter-style-demo/) ([code](https://github.com/mdn/css-examples/tree/main/counter-style-demo))
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The items typically display inline with a separator to indicate a hierarchy betw

> **Callout:**
>
> [Download this example](https://github.com/mdn/css-examples/blob/master/css-cookbook/breadcrumb-navigation--download.html)
> [Download this example](https://github.com/mdn/css-examples/blob/main/css-cookbook/breadcrumb-navigation--download.html)
> **Note:** The example above uses two selectors to insert content before every `li` except the first one. This could also be achieved using one selector only:
>
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/css/layout_cookbook/card/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ When added to a collection of cards, the cards should line up in two dimensions.

> **Callout:**
>
> [Download this example](https://github.com/mdn/css-examples/blob/master/css-cookbook/card--download.html)
> [Download this example](https://github.com/mdn/css-examples/blob/main/css-cookbook/card--download.html)
## Choices made

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ To place an item into the center of another box horizontally and vertically.

> **Callout:**
>
> [Download this example](https://github.com/mdn/css-examples/blob/master/css-cookbook/center--download.html)
> [Download this example](https://github.com/mdn/css-examples/blob/main/css-cookbook/center--download.html)
## Choices made

Expand Down
Loading

0 comments on commit cfc412a

Please sign in to comment.