Skip to content

Commit

Permalink
fix: Markdownlint spacing (#16075)
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed May 15, 2022
1 parent 7aeab87 commit 92464d0
Show file tree
Hide file tree
Showing 44 changed files with 153 additions and 177 deletions.
5 changes: 1 addition & 4 deletions files/en-us/glossary/primitive/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Most of the time, a primitive value is represented directly at the lowest level

All primitives are **immutable**, i.e., they cannot be altered. It is important not to confuse a primitive itself with a variable assigned a primitive value. The variable may be reassigned a new value, but the existing value can not be changed in the ways that objects, arrays, and functions can be altered.


## Example

### Autoboxing: primitive wrapper objects in JavaScript
Expand All @@ -29,7 +28,7 @@ console.log(mystring.length)
// 17
```

What actually happens is that a wrapper object associated with the primitive is automatically accessed instead.
What actually happens is that a wrapper object associated with the primitive is automatically accessed instead.
Except for `null` and `undefined`, all primitive values have object equivalents that wrap around the primitive values:

- {{jsxref("String")}} for the string primitive.
Expand All @@ -40,7 +39,6 @@ Except for `null` and `undefined`, all primitive values have object equivalents

The wrapper's [`valueOf()`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/valueOf) method returns the primitive value.


### Primitives are immutable

This example will help you understand that primitive values are **immutable**.
Expand All @@ -64,7 +62,6 @@ foo.push("plugh");
console.log(foo); // ["plugh"]
```


## See also

- [JavaScript data types](/en-US/docs/Web/JavaScript/Data_structures)
Expand Down
1 change: 0 additions & 1 deletion files/en-us/glossary/serializable_object/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ The new deserialized object will however be a {{glossary("deep copy")}}, so any
In some cases when serializing and deserializing an object, it makes sense to transfer some resources rather than creating a copy.
Objects that can be transferred are called {{Glossary("Transferable objects")}}.


## Supported objects

All primitive values are serializable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ async function enabledInActiveTab() {

## Browser compatibility

{{Compat}}
{{Compat}}
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ browser.menus.onClicked.addListener(() => {

## Browser compatibility

{{Compat}}
{{Compat}}
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ Values of this type are objects. They contain these properties:

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting#type-ContentScriptFilter) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Injects a script into a target context. The script is run at `document_idle` by
To use this API you must have the `"scripting"` [permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions) and permission for the target's URL, either explicitly as a [host permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#host_permissions) or using the [activeTab permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#activetab_permission).

In Firefox and Safari, partial lack of host permissions can result in a successful execution (with the partial results in the resolved promise). In Chrome, any missing permission prevents any execution from happening, see ([crbug 1325114](https://crbug.com/1325114))).

The scripts you inject are called [content scripts](/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_scripts).

This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
Expand Down Expand Up @@ -49,7 +49,7 @@ let results = await browser.scripting.executeScript(
- `injectImmediately`{{optional_inline}}
- : `boolean`. Whether the injection into the target is triggered as soon as possible, but not necessarily prior to page load.
- `target`
- : {{WebExtAPIRef("scripting.InjectionTarget")}}. Details specifying the target to inject the script into.
- : {{WebExtAPIRef("scripting.InjectionTarget")}}. Details specifying the target to inject the script into.

### Return value

Expand Down Expand Up @@ -117,11 +117,10 @@ browser.action.onClicked.addListener(async tab => {
});
```


{{WebExtExamples}}

## Browser compatibility

{{Compat}}

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting#method-executeScript) API.
> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting#method-executeScript) API.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Returns all the content scripts registered with {{WebExtAPIRef("scripting.regist
> **Note:** This method is available in Manifest V3 or higher in Chrome and Firefox 101. In Firefox 102+, this method is also available in Manifest V2.
To use this API you must have the `"scripting"` [permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions) and permission for the page's URL, either explicitly as a [host permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#host_permissions) or using the [activeTab permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#activetab_permission).

This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

## Syntax
Expand All @@ -32,7 +32,6 @@ let scripts = await browser.scripting.getRegisteredContentScripts(

### Parameters


- `filter` {{optional_inline}}
- : {{WebExtAPIRef("scripting.ContentScriptFilter")}}. A filter for the registered script details to return.

Expand Down Expand Up @@ -78,4 +77,4 @@ console.log(scripts.map(script => script.id)); // ["script-2"]

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting/#method-getRegisteredContentScripts) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ browser-compat: webextensions.api.scripting
{{AddonSidebar}}

Inserts JavaScript and CSS into websites. This API offers two approaches to inserting content:

- {{WebExtAPIRef("scripting.executeScript()")}}, {{WebExtAPIRef("scripting.insertCSS()")}}, and {{WebExtAPIRef("scripting.removeCSS()")}} that provide for one-off injections.
- {{WebExtAPIRef("scripting.registerContentScripts()")}} that registers content scripts dynamically, which can then be retrieved with {{WebExtAPIRef("scripting.getRegisteredContentScripts()")}} and unregistered with {{WebExtAPIRef("scripting.unregisterContentScripts()")}}).

Expand All @@ -31,7 +32,7 @@ Alternatively, you can get permission temporarily in the active tab and only in
- : Details of an injection target.
- {{WebExtAPIRef("scripting.RegisteredContentScript")}}
- : Details of a content script to be registered or that is registered.

## Functions

- {{WebExtAPIRef("scripting.executeScript()")}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ This object contains details specifying the injection target for CSS and JavaScr

Values of this type are objects. They contain these properties:

- `allFrames`{{optional_inline}}
- `allFrames`{{optional_inline}}
- : `boolean`. Whether the script or CSS is injected into all frames within the tab. Defaults to `false`. Cannot be `true` if `frameIds` is specified.
- `frameIds`{{optional_inline}}
- : `array` of `string`. Array of the IDs of the frames to inject into.
- `frameIds`{{optional_inline}}
- : `array` of `string`. Array of the IDs of the frames to inject into.
- `tabId`
- : `number`. The ID of the tab to inject into.
- : `number`. The ID of the tab to inject into.

## Browser compatibility

Expand All @@ -35,4 +35,4 @@ Values of this type are objects. They contain these properties:

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting#type-InjectionTarget) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ await browser.scripting.insertCSS(

- : An object describing the CSS to insert and where to insert it. It contains the following properties:

- `css`{{optional_inline}}
- : `string`. A string containing the CSS to inject. Either `css` or `files` must be specified.
- `css`{{optional_inline}}
- : `string`. A string containing the CSS to inject. Either `css` or `files` must be specified.
- `files`{{optional_inline}}
- : `array` of `string`. The path of a CSS files to inject, relative to the extension's root directory. Either `files` or `css` must be specified.
- `origin`{{optional_inline}}
- : `string`. The style origin for the injection, either `USER` or `AUTHOR`. Defaults to `AUTHOR`.
- `target`
- : {{WebExtAPIRef("scripting.InjectionTarget")}}. Details specifying the target to inject the CSS into.
- : `array` of `string`. The path of a CSS files to inject, relative to the extension's root directory. Either `files` or `css` must be specified.
- `origin`{{optional_inline}}
- : `string`. The style origin for the injection, either `USER` or `AUTHOR`. Defaults to `AUTHOR`.
- `target`
- : {{WebExtAPIRef("scripting.InjectionTarget")}}. Details specifying the target to inject the CSS into.

### Return value

Expand Down Expand Up @@ -99,4 +99,4 @@ browser.action.onClicked.addListener(async tab => {

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/docs/extensions/reference/scripting/#method-insertCSS) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ browser-compat: webextensions.api.scripting.registerContentScripts
---
{{AddonSidebar()}}

Registers one or more content scripts.
Registers one or more content scripts.

> **Note:** This method is available in Manifest V3 or higher in Chrome and Firefox 101. In Firefox 102+, this method is also available in Manifest V2.
To use this API you must have the `"scripting"` [permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions) and permission for the page's URL, either explicitly as a [host permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#host_permissions) or using the [activeTab permission](/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#activetab_permission).

This is an asynchronous function that returns a [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).

## Syntax
Expand All @@ -33,13 +33,12 @@ await browser.scripting.registerContentScripts(
### Parameters

- `scripts`
- : `array` of {{WebExtAPIRef("scripting.RegisteredContentScript")}}. A list of scripts to register.
- : `array` of {{WebExtAPIRef("scripting.RegisteredContentScript")}}. A list of scripts to register.

### Return value

A [`Promise`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that fulfills with an array of {{WebExtAPIRef("scripting.RegisteredContentScript")}}. If there are errors during script parsing and file validation, or if the IDs specified do not exist, no scripts are registered and the promise is rejected.


## Examples

This example registers a content script that injects the file `"script.js"`:
Expand All @@ -66,4 +65,4 @@ try {

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting#method-registerContentScripts) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Values of this type are objects. They contain these properties:

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting#type-RegisteredContentScript) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ await browser.scripting.removeCSS(

- : An object describing the CSS to remove and where to remove it from. It contains the following properties:

- `css`{{optional_inline}}
- `css`{{optional_inline}}
- : `string`. A string containing the CSS to inject. Either `css` or `files` must be specified and must match the stylesheet inserted through {{WebExtAPIRef("scripting.insertCSS()")}}.
- `files`{{optional_inline}}
- : `array` of `string`. The path of a CSS files to inject, relative to the extension's root directory. Either `files` or `css` must be specified and must match the stylesheet inserted through {{WebExtAPIRef("scripting.insertCSS()")}}.
- `origin`{{optional_inline}}
- `origin`{{optional_inline}}
- : `string`. The style origin for the injection, either `USER` or `AUTHOR`. Defaults to `AUTHOR`. Must match the origin of the stylesheet inserted through {{WebExtAPIRef("scripting.insertCSS()")}}.
- `target`
- : {{WebExtAPIRef("scripting.InjectionTarget")}}. Details specifying the target to remove the CSS from.
- `target`
- : {{WebExtAPIRef("scripting.InjectionTarget")}}. Details specifying the target to remove the CSS from.

### Return value

Expand Down Expand Up @@ -86,4 +86,4 @@ browser.action.onClicked.addListener(async tab => {

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/docs/extensions/reference/scripting/#method-removeCSS) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ await browser.scripting.unregisterContentScripts(

### Parameters

- `scripts`{{optional_inline}}
- `scripts`{{optional_inline}}
- : {{WebExtAPIRef("scripting.ContentScriptFilter")}}. A filter to identify the dynamic content scripts to unregistered. If not specified, all dynamic content scripts are unregistered.

### Return value
Expand Down Expand Up @@ -61,4 +61,4 @@ try {

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting#method-unregisterContentScripts) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ try {

> **Note:** This API is based on Chromium's [`chrome.scripting`](https://developer.chrome.com/extensions/scripting/#method-updateContentScripts) API.
>
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
> Microsoft Edge compatibility data is supplied by Microsoft Corporation and is included here under the Creative Commons Attribution 3.0 United States License.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ You can load a content script into a web page in one of three ways:
2. - At runtime, into pages that match URL patterns.
- : Using the {{WebExtAPIRef("contentScripts")}} API, you can ask the browser to load a content script whenever the browser loads a page whose URL [matches a given pattern](/en-US/docs/Mozilla/Add-ons/WebExtensions/Match_patterns). (This is similar to method 1, _except_ that you can add and remove content scripts at runtime.)
3. - At runtime, into specific tabs.
- : In Manifest V2, using [`tabs.executeScript()`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/executeScript), or Manifest V3, using {{WebExtAPIRef("scripting.executeScript()")}}, you can load a content script into a specific tab whenever you want. (For example, in response to the user clicking on a [browser action](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_action).)
- : In Manifest V2, using [`tabs.executeScript()`](/en-US/docs/Mozilla/Add-ons/WebExtensions/API/tabs/executeScript), or Manifest V3, using {{WebExtAPIRef("scripting.executeScript()")}}, you can load a content script into a specific tab whenever you want. (For example, in response to the user clicking on a [browser action](/en-US/docs/Mozilla/Add-ons/WebExtensions/user_interface/Browser_action).)

There is only one global scope _per frame, per extension_. This means that variables from one content script can directly be accessed by another content script, regardless of how the content script was loaded.

Expand Down Expand Up @@ -185,7 +185,7 @@ Content scripts get the same cross-domain privileges as the rest of the extensio

This is accomplished by exposing more privileged XHR and fetch instances in the content script, which has the side-effect of not setting the [`Origin`](/en-US/docs/Web/HTTP/Headers/Origin) and [`Referer`](/en-US/docs/Web/HTTP/Headers/Referer) headers like a request from the page itself would; this is often preferable to prevent the request from revealing its cross-origin nature.

> **Note:** In Firefox in Manifest V2, extensions that need to perform requests that behave as if they were sent by the content itself can use `content.XMLHttpRequest` and `content.fetch()` instead.
> **Note:** In Firefox in Manifest V2, extensions that need to perform requests that behave as if they were sent by the content itself can use `content.XMLHttpRequest` and `content.fetch()` instead.
>
> For cross-browser extensions, the presence of these methods must be feature-detected.
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ The `chrome_settings_overrides` key is an object that may have the following pro
<dt><code>favicon_url {{optional_inline}}</code></dt>
<dd>
String: URL pointing to an icon for the search engine. In Manifest V2,
this must be an absolute HTTP or HTTPS URL. In Manifest V3, this must
reference an icon provided in the extension as a path relative to the
this must be an absolute HTTP or HTTPS URL. In Manifest V3, this must
reference an icon provided in the extension as a path relative to the
extension's root.
</dd>
<dt><code>image_url {{optional_inline}}</code></dt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ In Manifest V3, the `content_security_policy` key is an object that may have any
Require that all types of content should be packaged with the extension:


**Manifest V2**

```json
Expand Down

0 comments on commit 92464d0

Please sign in to comment.