diff --git a/files/en-us/learn/server-side/apache_configuration_htaccess/index.html b/files/en-us/learn/server-side/apache_configuration_htaccess/index.html index 292721c1f385896..a7721d7e2f3c19b 100644 --- a/files/en-us/learn/server-side/apache_configuration_htaccess/index.html +++ b/files/en-us/learn/server-side/apache_configuration_htaccess/index.html @@ -450,7 +450,7 @@

Prevent some brow
  • upgrade-insecure-requests does not ensure HTTPS for the top-level navigation. If you want to force the website itself to be loaded over HTTPS you must include the Strict-Transport-Security header
  • -
  • Includes the Content-Security-Policy header in all responses that are able to execute scripting. This includes the commonly used file types: HTML, XML and PDF documents. Although Javascript files can not execute scripts in a "browsing context", they are included to target web workers
  • +
  • Includes the Content-Security-Policy header in all responses that are able to execute scripting. This includes the commonly used file types: HTML, XML and PDF documents. Although Javascript files can not execute scripts in a "browsing context", they are included to target web workers
  • Some older browsers would try and guess the content type of a resource, even when it isn't properly set up on the server configuration. This reduces exposure to drive-by download attacks and cross-origin data leaks.

    diff --git a/files/en-us/learn/server-side/django/models/index.html b/files/en-us/learn/server-side/django/models/index.html index ab4b40b232b6b28..b2864a9b2f3468b 100644 --- a/files/en-us/learn/server-side/django/models/index.html +++ b/files/en-us/learn/server-side/django/models/index.html @@ -412,8 +412,8 @@

    Re-run the database migrations

    All your models have now been created. Now re-run your database migrations to add them to your database.

    -
    python3 manage.py makemigrations
    -python3 manage.py migrate
    +
    python3 manage.py makemigrations
    +python3 manage.py migrate

    Language model — challenge

    @@ -430,8 +430,8 @@

    Language model — challenge

    Don't forget that after a change to your model, you should again re-run your database migrations to add the changes.

    -
    python3 manage.py makemigrations
    -python3 manage.py migrate
    +
    python3 manage.py makemigrations
    +python3 manage.py migrate

    Summary

    diff --git a/files/en-us/learn/server-side/django/skeleton_website/index.html b/files/en-us/learn/server-side/django/skeleton_website/index.html index 4b2f658f44daead..aaa09c66d323cc5 100644 --- a/files/en-us/learn/server-side/django/skeleton_website/index.html +++ b/files/en-us/learn/server-side/django/skeleton_website/index.html @@ -61,7 +61,7 @@

    Overview

    Creating the project

      -
    1. Open a command shell (or a terminal window), and make sure you are in your virtual environment
    2. +
    3. Open a command shell (or a terminal window), and make sure you are in your virtual environment
    4. Navigate to where you want to store your Django apps (make it somewhere easy to find like inside your Documents folder), and create a folder for your new website (in this case: django_projects). Then change into your newly-created directory:
      mkdir django_projects
       cd django_projects
      diff --git a/files/en-us/learn/server-side/express_nodejs/deployment/index.html b/files/en-us/learn/server-side/express_nodejs/deployment/index.html index 15220f83b9568dc..eb395c414a2a886 100644 --- a/files/en-us/learn/server-side/express_nodejs/deployment/index.html +++ b/files/en-us/learn/server-side/express_nodejs/deployment/index.html @@ -386,7 +386,7 @@

      Get dependencies and re-test

      npm install
       
      -

      Now run the site (see Testing the routes for the relevant commands) and check that the site still behaves as you expect.

      +

      Now run the site (see Testing the routes for the relevant commands) and check that the site still behaves as you expect.

      Save changes to Github

      @@ -454,7 +454,7 @@

      Setting configuration variables

      NODE_ENV: production -

      We should also use a separate database for production, setting its URI in the MONGODB_URI  environment variable. You can set up a new database and database-user exactly as we did originally, and get its URI. You can set the URI as shown (obviously, using your own URI!)

      +

      We should also use a separate database for production, setting its URI in the MONGODB_URI  environment variable. You can set up a new database and database-user exactly as we did originally, and get its URI. You can set the URI as shown (obviously, using your own URI!)

      >heroku config:set MONGODB_URI='mongodb+srv://cooluser:coolpassword@cluster0-mbdj7.mongodb.net/local_library?retryWrites=true'
       Setting MONGODB_URI and restarting limitless-tor-18923... done, v13
      diff --git a/files/en-us/learn/server-side/express_nodejs/displaying_data/book_list_page/index.html b/files/en-us/learn/server-side/express_nodejs/displaying_data/book_list_page/index.html
      index 3dbb08dde5dd268..81fa126ba41d2d0 100644
      --- a/files/en-us/learn/server-side/express_nodejs/displaying_data/book_list_page/index.html
      +++ b/files/en-us/learn/server-side/express_nodejs/displaying_data/book_list_page/index.html
      @@ -62,7 +62,7 @@ 

      View

      What does it look like?

      -

      Run the application (see Testing the routes for the relevant commands) and open your browser to http://localhost:3000/. Then select the All books link. If everything is set up correctly, your site should look something like the following screenshot.

      +

      Run the application (see Testing the routes for the relevant commands) and open your browser to http://localhost:3000/. Then select the All books link. If everything is set up correctly, your site should look something like the following screenshot.

      Book List Page - Express Local Library site

      diff --git a/files/en-us/learn/server-side/express_nodejs/displaying_data/genre_detail_page/index.html b/files/en-us/learn/server-side/express_nodejs/displaying_data/genre_detail_page/index.html index a681457e44e354f..450686db50944cc 100644 --- a/files/en-us/learn/server-side/express_nodejs/displaying_data/genre_detail_page/index.html +++ b/files/en-us/learn/server-side/express_nodejs/displaying_data/genre_detail_page/index.html @@ -62,7 +62,7 @@

      Controller

      }
      -

      The message will then propagate through to our error handling code (this was set up when we generated the app skeleton - for more information see Handling Errors).

      +

      The message will then propagate through to our error handling code (this was set up when we generated the app skeleton - for more information see Handling Errors).

      The rendered view is genre_detail and it is passed variables for the title, genre and the list of books in this genre (genre_books).

      diff --git a/files/en-us/learn/server-side/express_nodejs/displaying_data/locallibrary_base_template/index.html b/files/en-us/learn/server-side/express_nodejs/displaying_data/locallibrary_base_template/index.html index be927429ac1ad52..d261746ee44253d 100644 --- a/files/en-us/learn/server-side/express_nodejs/displaying_data/locallibrary_base_template/index.html +++ b/files/en-us/learn/server-side/express_nodejs/displaying_data/locallibrary_base_template/index.html @@ -55,7 +55,7 @@

      The template uses (and includes) JavaScript and CSS from Bootstrap to improve the layout and presentation of the HTML page. Using Bootstrap or another client-side web framework is a quick way to create an attractive page that can scale well on different browser sizes, and it also allows us to deal with the page presentation without having to get into any of the details—we just want to focus on the server-side code here!

      -

      The layout should be fairly obvious if you've read our above Template primer. Note the use of block content as a placeholder for where the content for our individual pages will be placed.

      +

      The layout should be fairly obvious if you've read our above Template primer. Note the use of block content as a placeholder for where the content for our individual pages will be placed.

      The base template also references a local css file (style.css) that provides a little additional styling. Open /public/stylesheets/style.css and replace its content with the following CSS code:

      diff --git a/files/en-us/learn/server-side/first_steps/introduction/index.html b/files/en-us/learn/server-side/first_steps/introduction/index.html index 7cfb53d4988deb8..062a6edf7dd5002 100644 --- a/files/en-us/learn/server-side/first_steps/introduction/index.html +++ b/files/en-us/learn/server-side/first_steps/introduction/index.html @@ -51,7 +51,7 @@

      Static sites

      The diagram below shows a basic web server architecture for a static site (a static site is one that returns the same hard-coded content from the server whenever a particular resource is requested). When a user wants to navigate to a page, the browser sends an HTTP "GET" request specifying its URL.

      -

      The server retrieves the requested document from its file system and returns an HTTP response containing the document and a success status (usually 200 OK). If the file cannot be retrieved for some reason, an error status is returned (see client error responses and server error responses).

      +

      The server retrieves the requested document from its file system and returns an HTTP response containing the document and a success status (usually 200 OK). If the file cannot be retrieved for some reason, an error status is returned (see client error responses and server error responses).

      A simplified diagram of a static web server.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/index.html b/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/index.html index 6aaa54711b4238c..1c8c3e44d4ce181 100644 --- a/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/index.html @@ -46,7 +46,7 @@

      A simple button

      } -

      This specifies that we'll have a background script named "background.js", and a browser action (button) whose icons will live in the "icons" directory.

      +

      This specifies that we'll have a background script named "background.js", and a browser action (button) whose icons will live in the "icons" directory.

      These icons are from the bitsies! iconset created by Recep Kütük.
      @@ -55,8 +55,8 @@

      A simple button

      Next, create the "icons" directory inside the "buttons" directory, and save the two icons shown below inside it:

        -
      • "page-16.png" ()
      • -
      • "page-32.png" ().
      • +
      • "page-16.png" ()
      • +
      • "page-32.png" ().

      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.

      @@ -82,7 +82,7 @@

      A simple button

      background.js manifest.json -

      Now install the extension and click the button:

      +

      Now install the extension and click the button:

      {{EmbedYouTube("kwwTowgT-Ys")}}

      @@ -191,7 +191,7 @@

      Adding a popup

      Page actions

      -

      Page actions are just like browser actions, except that they are for actions which are relevant only for particular pages, rather than the browser as a whole.

      +

      Page actions are just like browser actions, except that they are for actions which are relevant only for particular pages, rather than the browser as a whole.

      While browser actions are always shown, page actions are only shown in tabs where they are relevant. Page action buttons are displayed in the URL bar, rather than the browser toolbar.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/page-16.png b/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/page-16.png new file mode 100644 index 000000000000000..8abaacc90f44c7a Binary files /dev/null and b/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/page-16.png differ diff --git a/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/page-32.png b/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/page-32.png new file mode 100644 index 000000000000000..836f6e16be48d23 Binary files /dev/null and b/files/en-us/mozilla/add-ons/webextensions/add_a_button_to_the_toolbar/page-32.png differ diff --git a/files/en-us/mozilla/add-ons/webextensions/anatomy_of_a_webextension/index.html b/files/en-us/mozilla/add-ons/webextensions/anatomy_of_a_webextension/index.html index 530597fe1be3121..ee146e30c6b9a41 100644 --- a/files/en-us/mozilla/add-ons/webextensions/anatomy_of_a_webextension/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/anatomy_of_a_webextension/index.html @@ -15,19 +15,19 @@

      manifest.json

      The manifest can also contain pointers to several other types of files:

      -
      Background scripts
      +
      Background scripts
      Implement long-running logic.
      Icons
      For the extension and any buttons it might define.
      -
      Sidebars, popups, and options pages:
      +
      Sidebars, popups, and options pages:
      HTML documents that provide content for various user interface components.
      -
      Content scripts
      +
      Content scripts
      JavaScript included with your extension, that you will inject into web pages.
      -
      Web-accessible resources
      +
      Web-accessible resources
      Make packaged content accessible to web pages and content scripts.
      -

      +

      See the manifest.json reference page for all the details.

      @@ -37,7 +37,7 @@

      Background scripts

      Extensions often need to maintain long-term state or perform long-term operations independently of the lifetime of any particular web page or browser window. That is what background scripts are for.

      -

      Background scripts are loaded as soon as the extension is loaded and stay loaded until the extension is disabled or uninstalled. You can use any of the WebExtension APIs in the script, as long as you have requested the necessary permissions.

      +

      Background scripts are loaded as soon as the extension is loaded and stay loaded until the extension is disabled or uninstalled. You can use any of the WebExtension APIs in the script, as long as you have requested the necessary permissions.

      Specifying background scripts

      @@ -86,7 +86,7 @@

      DOM APIs

      WebExtension APIs

      -

      Background scripts can use any of the WebExtension APIs in the script, as long as their extension has the necessary permissions.

      +

      Background scripts can use any of the WebExtension APIs in the script, as long as their extension has the necessary permissions.

      Cross-origin access

      @@ -94,7 +94,7 @@

      Cross-origin access

      Web content

      -

      Background scripts do not get direct access to web pages. However, they can load content scripts into web pages and can communicate with these content scripts using a message-passing API.

      +

      Background scripts do not get direct access to web pages. However, they can load content scripts into web pages and can communicate with these content scripts using a message-passing API.

      Content security policy

      @@ -140,7 +140,7 @@

      Content scripts

      Content scripts cannot directly access normal page scripts but can exchange messages with them using the standard window.postMessage() API.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/anatomy_of_a_webextension/webextension-anatomy.png b/files/en-us/mozilla/add-ons/webextensions/anatomy_of_a_webextension/webextension-anatomy.png new file mode 100644 index 000000000000000..2464c82e5565d76 Binary files /dev/null and b/files/en-us/mozilla/add-ons/webextensions/anatomy_of_a_webextension/webextension-anatomy.png differ diff --git a/files/en-us/mozilla/add-ons/webextensions/api/alarms/index.html b/files/en-us/mozilla/add-ons/webextensions/api/alarms/index.html index b6bc9fb34358bd4..5684a1688d6f816 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/alarms/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/alarms/index.html @@ -12,7 +12,7 @@ ---
      {{AddonSidebar}}
      -

      Schedule code to run at a specific time in the future. This is like setTimeout() and setInterval(), except that those functions don't work with background pages that are loaded on demand. Alarms do not persist across browser sessions.

      +

      Schedule code to run at a specific time in the future. This is like setTimeout() and setInterval(), except that those functions don't work with background pages that are loaded on demand. Alarms do not persist across browser sessions.

      To use this API you need to have the "alarms" permission.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/index.html b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/index.html index 6844c0249ee07a1..c329a7b8d1a53bf 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/index.html @@ -83,9 +83,9 @@

      Browser compatibility

      {{Compat("webextensions.api.bookmarks")}}

      {{WebExtExamples("h2")}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onchanged/index.html b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onchanged/index.html index 7c763e24dc9caf5..4777891bcfe11fa 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onchanged/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onchanged/index.html @@ -55,7 +55,7 @@

      Parameters

      changeInfo
      -
      object. Object containing two properties: title, a string containing the item's title, and url, a string containing the item's URL. If the item is a folder, url is omitted.
      +
      object. Object containing two properties: title, a string containing the item's title, and url, a string containing the item's URL. If the item is a folder, url is omitted.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onchildrenreordered/index.html b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onchildrenreordered/index.html index 5f85e173c10447f..e16f724531e4cad 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onchildrenreordered/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onchildrenreordered/index.html @@ -50,7 +50,7 @@

      Parameters

      reorderInfo
      -
      object. Object containing Additional objects.
      +
      object. Object containing Additional objects.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onmoved/index.html b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onmoved/index.html index 7dd13f31858b08f..7d93159ff267d94 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onmoved/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onmoved/index.html @@ -50,7 +50,7 @@

      Parameters

      moveInfo
      -
      object. Object containing more details about the move.
      +
      object. Object containing more details about the move.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onremoved/index.html b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onremoved/index.html index 310ad8bc9f6e600..21d20ae62b364ed 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onremoved/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/onremoved/index.html @@ -50,7 +50,7 @@

      Parameters

      removeInfo
      -
      object. More details about the removed item.
      +
      object. More details about the removed item.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/search/index.html b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/search/index.html index 4b5ad6f206b0d2f..242bca32ebf0f65 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/search/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/bookmarks/search/index.html @@ -16,7 +16,7 @@

      The bookmarks.search() function searches for bookmark tree nodes matching the given query.

      -

      This function throws an exception if any of the input parameters are invalid or are not of an appropriate type; look in the console for the error message. The exceptions don't have error IDs, and the messages themselves may change, so don't write code that tries to interpret them.

      +

      This function throws an exception if any of the input parameters are invalid or are not of an appropriate type; look in the console for the error message. The exceptions don't have error IDs, and the messages themselves may change, so don't write code that tries to interpret them.

      This is an asynchronous function that returns a Promise.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/gettitle/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/gettitle/index.html index 16b7ee66a43f144..a045c20ab73eacd 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/gettitle/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/gettitle/index.html @@ -61,18 +61,18 @@

      Examples

      This code switches the title between "this" and "that" each time the user clicks the browser action:

      -
      function toggleTitle(title) {
      -  if (title == "this") {
      -    browser.browserAction.setTitle({title: "that"});
      -  } else {
      -    browser.browserAction.setTitle({title: "this"});
      -  }
      -}
      -
      -browser.browserAction.onClicked.addListener(() => {
      -  var gettingTitle = browser.browserAction.getTitle({});
      -  gettingTitle.then(toggleTitle);
      -});
      +
      function toggleTitle(title) {
      +  if (title == "this") {
      +    browser.browserAction.setTitle({title: "that"});
      +  } else {
      +    browser.browserAction.setTitle({title: "this"});
      +  }
      +}
      +
      +browser.browserAction.onClicked.addListener(() => {
      +  var gettingTitle = browser.browserAction.getTitle({});
      +  gettingTitle.then(toggleTitle);
      +});

      {{WebExtExamples}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/index.html index cd697dc930033bb..865cfc4c80a34ac 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/index.html @@ -15,9 +15,9 @@

      Adds a button to the browser's toolbar.

      -

      A browser action is a button in the browser's toolbar.

      +

      A browser action is a button in the browser's toolbar.

      -

      You can associate a popup with the button. The popup is specified using HTML, CSS and JavaScript, just like a normal web page. JavaScript running in the popup gets access to all the same WebExtension APIs as your background scripts, but its global context is the popup, not the current page displayed in the browser. To affect web pages you need to communicate with them via messages.

      +

      You can associate a popup with the button. The popup is specified using HTML, CSS and JavaScript, just like a normal web page. JavaScript running in the popup gets access to all the same WebExtension APIs as your background scripts, but its global context is the popup, not the current page displayed in the browser. To affect web pages you need to communicate with them via messages.

      If you specify a popup, it will be shown — and the content will be loaded — when the user clicks the icon. If you do not specify a popup, then when the user clicks the icon an event is dispatched to your extension.

      @@ -86,9 +86,9 @@

      Browser compatibility

      {{Compat("webextensions.api.browserAction")}}

      {{WebExtExamples("h2")}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/onclicked/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/onclicked/index.html index a43f8e2060122ee..ad11abe5a99afe1 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/onclicked/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/onclicked/index.html @@ -16,11 +16,11 @@

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

      -

      To define a right-click action, use the contextMenus API with the "browser_action" context type.

      +

      To define a right-click action, use the contextMenus API with the "browser_action" context type.

      Syntax

      -
      browser.browserAction.onClicked.addListener(listener)
      +
      browser.browserAction.onClicked.addListener(listener)
       browser.browserAction.onClicked.removeListener(listener)
       browser.browserAction.onClicked.hasListener(listener)
       
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/seticon/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/seticon/index.html index 34aaf547f9fba41..febaac783e8d64b 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browseraction/seticon/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browseraction/seticon/index.html @@ -44,12 +44,12 @@

      Parameters

      Use a dictionary object to specify multiple ImageData objects in different sizes, so the icon does not have to be scaled for a device with a different pixel density. If imageData is a dictionary, the value of each property is an ImageData object, and its name is its size, like this:

      -
      {
      -  16: image16,
      -  32: image32
      -}
      +
      {
      +  16: image16,
      +  32: image32
      +}
      -

      The browser will choose the image to use depending on the screen's pixel density. See Choosing icon sizes for more information on this.

      +

      The browser will choose the image to use depending on the screen's pixel density. See Choosing icon sizes for more information on this.

      path{{optional_inline}}
      @@ -57,12 +57,12 @@

      Parameters

      Use a dictionary object to specify multiple icon files in different sizes, so the icon does not have to be scaled for a device with a different pixel density. If path is a dictionary, the value of each property is a relative path, and its name is its size, like this:

      -
      {
      -  16: "path/to/image16.jpg",
      -  32: "path/to/image32.jpg"
      -}
      +
      {
      +  16: "path/to/image16.jpg",
      +  32: "path/to/image32.jpg"
      +}
      -

      The browser will choose the image to use depending on the screen's pixel density. See Choosing icon sizes for more information on this.

      +

      The browser will choose the image to use depending on the screen's pixel density. See Choosing icon sizes for more information on this.

      tabId{{optional_inline}}
      integer. Sets the icon only for the given tab. The icon is reset when the user navigates this tab to a new page.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsersettings/allowpopupsforuserevents/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsersettings/allowpopupsforuserevents/index.html index 6ae516ff11ddfd1..eddb5699ca05e3d 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsersettings/allowpopupsforuserevents/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsersettings/allowpopupsforuserevents/index.html @@ -16,7 +16,7 @@

      The underlying value is a boolean.

      -

      By default, browsers allow web pages to open popups in response to a particular set of events: for example, click, mouseup, submit. If allowPopupsForUserEvents is set to false, no user events will be able to open popups. If it is set to true, the default set of events will be allowed to open popups.

      +

      By default, browsers allow web pages to open popups in response to a particular set of events: for example, click, mouseup, submit. If allowPopupsForUserEvents is set to false, no user events will be able to open popups. If it is set to true, the default set of events will be allowed to open popups.

      For example, suppose a web page has code like this:

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsersettings/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsersettings/index.html index 05ef2d130b94795..6a1e0515db46ad7 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsersettings/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsersettings/index.html @@ -14,7 +14,7 @@
      Enables an extension to modify certain global browser settings. Each property of this API is a {{WebExtAPIRef("types.BrowserSetting", "BrowserSetting")}} object, providing the ability to modify a particular setting.
      -
      Because these are global settings, it's possible for extensions to conflict. See the documentation for BrowserSetting.set() for details of how conflicts are handled.
      +
      Because these are global settings, it's possible for extensions to conflict. See the documentation for BrowserSetting.set() for details of how conflicts are handled.

      To use this API you need to have the "browserSettings" permission.

      @@ -52,7 +52,7 @@

      Properties

      {{WebExtAPIRef("browserSettings.useDocumentFonts")}}
      Controls whether the browser will use the fonts specified by a web page or use only built-in fonts.
      {{WebExtAPIRef("browserSettings.webNotificationsDisabled")}}
      -
      Prevents websites from showing notifications using the Notification Web API.
      +
      Prevents websites from showing notifications using the Notification Web API.
      {{WebExtAPIRef("browserSettings.zoomFullPage")}}
      Controls whether zoom is applied to the entire page or to text only.
      {{WebExtAPIRef("browserSettings.zoomSiteSpecific")}}
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/index.html index 1f73803f83ab255..b911e607843dc9d 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/index.html @@ -38,7 +38,7 @@

      Finally, this API gives you a {{WebExtAPIRef("browsingData.settings()")}} function that gives you the current value of the settings for the browser's built-in "Clear History" feature.

      -

      To use this API you must have the "browsingData" API permission.

      +

      To use this API you must have the "browsingData" API permission.

      Types

      @@ -79,9 +79,9 @@

      Browser compatibility

      {{Compat("webextensions.api.browsingData", 2)}}

      {{WebExtExamples("h2")}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html index a00022ce9df521e..da153e2516fd3d9 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/remove/index.html @@ -74,17 +74,17 @@

      Examples

      Remove all download and browsing history:

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -browser.browsingData.remove({},
      -  {downloads: true, history: true}).
      -then(onRemoved, onError);
      +browser.browsingData.remove({}, + {downloads: true, history: true}). +then(onRemoved, onError);

      {{WebExtExamples}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html index fa0947cdbf17848..25a13e4263a01f5 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removecookies/index.html @@ -79,16 +79,16 @@

      Examples

      If you want to clear all cookies without disrupting local storage facilities, use browser.cookies to loop through and remove the contents of all cookie stores.

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -browser.browsingData.removeCookies({}).
      -then(onRemoved, onError);
      +browser.browsingData.removeCookies({}). +then(onRemoved, onError);

      {{WebExtExamples}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removedownloads/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removedownloads/index.html index d1014a69c276c55..8e3de4972f2fee7 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removedownloads/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removedownloads/index.html @@ -52,36 +52,36 @@

      Examples

      Remove records of objects downloaded in the last week:

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -function weekInMilliseconds() {
      -  return 1000 * 60 * 60 * 24 * 7;
      -}
      +function weekInMilliseconds() {
      +  return 1000 * 60 * 60 * 24 * 7;
      +}
       
      -var oneWeekAgo = (new Date()).getTime() - weekInMilliseconds();
      +var oneWeekAgo = (new Date()).getTime() - weekInMilliseconds();
       
      -browser.browsingData.removeDownloads(
      -  {since: oneWeekAgo}).
      -then(onRemoved, onError);
      +browser.browsingData.removeDownloads( + {since: oneWeekAgo}). +then(onRemoved, onError);

      Remove all records of downloaded objects:

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -browser.browsingData.removeDownloads({}).
      -then(onRemoved, onError);
      +browser.browsingData.removeDownloads({}). +then(onRemoved, onError);

      {{WebExtExamples}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removeformdata/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removeformdata/index.html index da925d6536ca19f..398586fa68564f7 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removeformdata/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removeformdata/index.html @@ -52,36 +52,36 @@

      Examples

      Remove form data saved in the last week:

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -function weekInMilliseconds() {
      -  return 1000 * 60 * 60 * 24 * 7;
      -}
      +function weekInMilliseconds() {
      +  return 1000 * 60 * 60 * 24 * 7;
      +}
       
      -var oneWeekAgo = (new Date()).getTime() - weekInMilliseconds();
      +var oneWeekAgo = (new Date()).getTime() - weekInMilliseconds();
       
      -browser.browsingData.removeFormData(
      -  {since: oneWeekAgo}).
      -then(onRemoved, onError);
      +browser.browsingData.removeFormData( + {since: oneWeekAgo}). +then(onRemoved, onError);

      Remove all saved form data:

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -browser.browsingData.removeFormData({}).
      -then(onRemoved, onError);
      +browser.browsingData.removeFormData({}). +then(onRemoved, onError);

      {{WebExtExamples}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html index d4a2359e98436aa..2b841f91a6b73b4 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removehistory/index.html @@ -52,36 +52,36 @@

      Examples

      Remove records of pages visited in the last week:

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -function weekInMilliseconds() {
      -  return 1000 * 60 * 60 * 24 * 7;
      -}
      +function weekInMilliseconds() {
      +  return 1000 * 60 * 60 * 24 * 7;
      +}
       
      -var oneWeekAgo = (new Date()).getTime() - weekInMilliseconds();
      +var oneWeekAgo = (new Date()).getTime() - weekInMilliseconds();
       
      -browser.browsingData.removeHistory(
      -  {since: oneWeekAgo}).
      -then(onRemoved, onError);
      +browser.browsingData.removeHistory( + {since: oneWeekAgo}). +then(onRemoved, onError);

      Remove all records of visited pages:

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -browser.browsingData.removeHistory({}).
      -then(onRemoved, onError);
      +browser.browsingData.removeHistory({}). +then(onRemoved, onError);

      {{WebExtExamples}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removelocalstorage/index.html b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removelocalstorage/index.html index 68b3617efaab0f2..0eca8e9f3f17171 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removelocalstorage/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/browsingdata/removelocalstorage/index.html @@ -52,16 +52,16 @@

      Examples

      Remove all local storage:

      -
      function onRemoved() {
      -  console.log("removed");
      -}
      +
      function onRemoved() {
      +  console.log("removed");
      +}
       
      -function onError(error) {
      -  console.error(error);
      -}
      +function onError(error) {
      +  console.error(error);
      +}
       
      -browser.browsingData.removeLocalStorage({}).
      -then(onRemoved, onError);
      +browser.browsingData.removeLocalStorage({}). +then(onRemoved, onError);

      {{WebExtExamples}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/captiveportal/index.html b/files/en-us/mozilla/add-ons/webextensions/api/captiveportal/index.html index ae81557f19ff185..9a973ea3d09eb46 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/captiveportal/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/captiveportal/index.html @@ -48,9 +48,9 @@

      Browser compatibility

      {{Compat("webextensions.api.captivePortal")}}

      {{WebExtExamples("h2")}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/clipboard/index.html b/files/en-us/mozilla/add-ons/webextensions/api/clipboard/index.html index e826e7195d33269..30c738be8dc0811 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/clipboard/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/clipboard/index.html @@ -15,7 +15,7 @@

      This WebExtension API exists primarily because the standard web clipboard API doesn't support writing images to the clipboard. This API may be deprecated once the Clipboard API's support for non-text clipboard contents has entered general use.

      -

      Reading from the clipboard is not supported by this API, because the clipboard can already be read using the standard web platform APIs. See Interacting with the clipboard.

      +

      Reading from the clipboard is not supported by this API, because the clipboard can already be read using the standard web platform APIs. See Interacting with the clipboard.

      This API is based on Chrome's clipboard API, but that API is only available for Chrome apps, not extensions.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.html b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.html index 1db03aa7ecebb06..8bb56e68fdda1a4 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/command/index.html @@ -14,7 +14,7 @@ ---
      {{AddonSidebar()}}
      -

      Information about a command. This contains the information specified for the command in the commands manifest.json key.

      +

      Information about a command. This contains the information specified for the command in the commands manifest.json key.

      An array of these objects is returned from {{WebExtAPIRef('commands.getAll()')}}.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/getall/index.html b/files/en-us/mozilla/add-ons/webextensions/api/commands/getall/index.html index c7086f77447dc45..4fd66a3dc1010fe 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/getall/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/getall/index.html @@ -14,7 +14,7 @@ ---
      {{AddonSidebar()}}
      -

      Gets all commands for the extension that you have registered using the commands manifest.json key.

      +

      Gets all commands for the extension that you have registered using the commands manifest.json key.

      The commands are returned as an array of {{WebExtAPIRef('commands.Command')}} objects. Alternately, if you are using the promise-based version of the API, browser.commands.getAll(), the commands are passed into the onFulfilled argument to Promise.then().

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/index.html b/files/en-us/mozilla/add-ons/webextensions/api/commands/index.html index 16f5218dc407de6..2cd2368a3866a86 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/index.html @@ -12,13 +12,13 @@ ---
      {{AddonSidebar}}
      -

      Listen for the user executing commands that you have registered using the commands manifest.json key.

      +

      Listen for the user executing commands that you have registered using the commands manifest.json key.

      Types

      {{WebExtAPIRef("commands.Command")}}
      -
      Object representing a command. This contains the information specified for the command in the commands manifest.json key.
      +
      Object representing a command. This contains the information specified for the command in the commands manifest.json key.

      Functions

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/oncommand/index.html b/files/en-us/mozilla/add-ons/webextensions/api/commands/oncommand/index.html index 218e1f38d2468c6..e417a1eafd72adc 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/oncommand/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/oncommand/index.html @@ -17,7 +17,7 @@
      Fired when a command is executed using its associated keyboard shortcut.
      -
      The listener is passed the command's name. This matches the name given to the command in its manifest.json entry.
      +
      The listener is passed the command's name. This matches the name given to the command in its manifest.json entry.

      Syntax

      @@ -48,7 +48,7 @@

      Parameters

      name
      -
      string. Name of the command. This matches the name given to the command in its manifest.json entry.
      +
      string. Name of the command. This matches the name given to the command in its manifest.json entry.
      @@ -65,25 +65,25 @@

      Examples

      -
      "commands": {
      -  "toggle-feature": {
      -    "suggested_key": {
      -      "default": "Ctrl+Shift+Y"
      -    },
      -    "description": "Send a 'toggle-feature' event"
      -  }
      -}
      +
      "commands": {
      +  "toggle-feature": {
      +    "suggested_key": {
      +      "default": "Ctrl+Shift+Y"
      +    },
      +    "description": "Send a 'toggle-feature' event"
      +  }
      +}
      You could listen for this particular command like this:
      -
      browser.commands.onCommand.addListener(function(command) {
      -  if (command == "toggle-feature") {
      -    console.log("toggling the feature!");
      -  }
      -});
      +
      browser.commands.onCommand.addListener(function(command) {
      +  if (command == "toggle-feature") {
      +    console.log("toggling the feature!");
      +  }
      +});

      {{WebExtExamples}}

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/reset/index.html b/files/en-us/mozilla/add-ons/webextensions/api/commands/reset/index.html index d9f2ded24e84975..ff4d96742ab3614 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/reset/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/reset/index.html @@ -13,7 +13,7 @@ ---
      {{AddonSidebar()}}
      -

      Resets the given command's description and keyboard shortcut to the values given in the extension's commands manifest.json key.

      +

      Resets the given command's description and keyboard shortcut to the values given in the extension's commands manifest.json key.

      This effectively undoes any changes made to the command using the {{WEbExtAPIRef("commands.update()")}} function.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/commands/update/index.html b/files/en-us/mozilla/add-ons/webextensions/api/commands/update/index.html index da0d07179ce655c..a1acffbc4872646 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/commands/update/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/commands/update/index.html @@ -39,7 +39,7 @@

      Parameters

      string. A new shortcut to set for the command. This can be:
      • an empty string to clear the shortcut.
      • -
      • a string matching the format of the commands manifest.json key to set a new shortcut key. If the string does not match this format, the function throws an error.
      • +
      • a string matching the format of the commands manifest.json key to set a new shortcut key. If the string does not match this format, the function throws an error.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/contentscripts/index.html b/files/en-us/mozilla/add-ons/webextensions/api/contentscripts/index.html index 6a366a826713e59..a78e398dbbf1377 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/contentscripts/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/contentscripts/index.html @@ -19,7 +19,7 @@

      The RegisteredContentScript object represents the scripts that were registered in the register() call. It defines an unregister() method that you can use to unregister the content scripts. Content scripts are also unregistered automatically when the page that created them is destroyed. For example, if they are registered from the background page they will be unregistered automatically when the background page is destroyed, and if they are registered from a sidebar or a popup, they will be unregistered automatically when the sidebar or popup is closed.

      -

      There is no contentScripts API permission, but an extension must have the appropriate host permissions for any patterns it passes to register().

      +

      There is no contentScripts API permission, but an extension must have the appropriate host permissions for any patterns it passes to register().

      Types

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/contextualidentities/containers.png b/files/en-us/mozilla/add-ons/webextensions/api/contextualidentities/containers.png new file mode 100644 index 000000000000000..0796e79ff07b787 Binary files /dev/null and b/files/en-us/mozilla/add-ons/webextensions/api/contextualidentities/containers.png differ diff --git a/files/en-us/mozilla/add-ons/webextensions/api/contextualidentities/index.html b/files/en-us/mozilla/add-ons/webextensions/api/contextualidentities/index.html index 1115a8ddcc1224e..4baa37bdb59bc8b 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/contextualidentities/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/contextualidentities/index.html @@ -12,7 +12,7 @@

      With the contextual identities feature, each contextual identity has a name, a color, and an icon. New tabs can be assigned to an identity, and the name, icon, and color will appear in the address bar. Internally, each identity gets its own cookie store which is not shared with other tabs.

      -

      Contextual identities are an experimental feature in Firefox and are only enabled by default in Firefox Nightly. To enable them in other versions of Firefox, set the privacy.userContext.enabled preference to true. Note that although contextual identities are available in Firefox for Android, there's no UI to work with them in this version of the browser.

      +

      Contextual identities are an experimental feature in Firefox and are only enabled by default in Firefox Nightly. To enable them in other versions of Firefox, set the privacy.userContext.enabled preference to true. Note that although contextual identities are available in Firefox for Android, there's no UI to work with them in this version of the browser.

      Before Firefox 57, the contextualIdentities API is only available if the contextual identities feature is itself enabled. If an extension tried to use the contextualIdentities API without the feature being enabled, then method calls would resolve their promises with false.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/cookies/cookie/index.html b/files/en-us/mozilla/add-ons/webextensions/api/cookies/cookie/index.html index 0b724f98608b357..56ccada24105d76 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/cookies/cookie/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/cookies/cookie/index.html @@ -26,7 +26,7 @@

      Type

      expirationDate{{optional_inline}}
      A number representing the expiration date of the cookie as the number of seconds since the UNIX epoch. Not provided for session cookies.
      firstPartyDomain
      -
      A string representing the first-party domain associated with the cookie. This will be an empty string if the cookie was set while first-party isolation was off. See First-party isolation.
      +
      A string representing the first-party domain associated with the cookie. This will be an empty string if the cookie was set while first-party isolation was off. See First-party isolation.
      hostOnly
      A boolean, true if the cookie is a host-only cookie (i.e. the request's host must exactly match the domain of the cookie), or false otherwise.
      httpOnly
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/cookies/cookiestore/index.html b/files/en-us/mozilla/add-ons/webextensions/api/cookies/cookiestore/index.html index a84a8419f0c1c33..15f44ef15b38208 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/cookies/cookiestore/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/cookies/cookiestore/index.html @@ -41,14 +41,14 @@

      Examples

      In the following snippet, the {{WebExtAPIRef("cookies.getAllCookieStores()")}} method is used to retrieve all the cookie stores currently available in the browser, and print out each cookie store ID, and the tabs that currently share each cookie store.

      -
      function logStores(cookieStores) {
      -  for(store of cookieStores) {
      -    console.log(`Cookie store: ${store.id}\n Tab IDs: ${store.tabIds}`);
      -  }
      -}
      -
      -var getting = browser.cookies.getAllCookieStores();
      -getting.then(logStores);
      +
      function logStores(cookieStores) {
      +  for(store of cookieStores) {
      +    console.log(`Cookie store: ${store.id}\n Tab IDs: ${store.tabIds}`);
      +  }
      +}
      +
      +var getting = browser.cookies.getAllCookieStores();
      +getting.then(logStores);

      The following code snippet gets all cookie stores and then logs the total number of stores and how many of those stores are incognito.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/cookies/get/index.html b/files/en-us/mozilla/add-ons/webextensions/api/cookies/get/index.html index 5d4e6d4d37684db..bb1d4be74c43867 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/cookies/get/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/cookies/get/index.html @@ -35,13 +35,13 @@

      Parameters

      firstPartyDomain{{optional_inline}}
      -
      A string representing the first-party domain with which the cookie to retrieve is associated. This property must be supplied if the browser has first-party isolation enabled. See First-party isolation.
      +
      A string representing the first-party domain with which the cookie to retrieve is associated. This property must be supplied if the browser has first-party isolation enabled. See First-party isolation.
      name
      A string representing the name of the cookie to retrieve.
      storeId{{optional_inline}}
      A string representing the ID of the {{WebExtAPIRef("cookies.CookieStore", "cookie store")}} in which to look for the cookie (as returned by {{WebExtAPIRef("cookies.getAllCookieStores()")}}). By default, the current execution context's cookie store will be used.
      url
      -
      A string representing the URL with which the cookie to retrieve is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is ignored. If host permissions for this URL are not specified in the extension's manifest file, the API call will fail.
      +
      A string representing the URL with which the cookie to retrieve is associated. This argument may be a full URL, in which case any data following the URL path (e.g. the query string) is ignored. If host permissions for this URL are not specified in the extension's manifest file, the API call will fail.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/cookies/getall/index.html b/files/en-us/mozilla/add-ons/webextensions/api/cookies/getall/index.html index 99dbb8a158a14c4..d92308b3d2318f2 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/cookies/getall/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/cookies/getall/index.html @@ -29,14 +29,14 @@

      Parameters

      details
      -
      An object containing details that can be used to match cookies to be retrieved. Included properties are as follows (see Cookie type for more information on these):
      +
      An object containing details that can be used to match cookies to be retrieved. Included properties are as follows (see Cookie type for more information on these):
      domain{{optional_inline}}
      A string representing a domain that cookies must be associated with (they can be associated either with this exact domain or one of its subdomains).
      firstPartyDomain{{optional_inline}}
      A string representing the first-party domain with which the cookie to retrieve is associated.
      -
      This property must be supplied if the browser has first-party isolation enabled. You can however pass null in this situation. If you do this, then cookies with any value for firstPartyDomain, as well as cookies which do not have firstPartyDomain set at all, will be included in the results. See First-party isolation.
      +
      This property must be supplied if the browser has first-party isolation enabled. You can however pass null in this situation. If you do this, then cookies with any value for firstPartyDomain, as well as cookies which do not have firstPartyDomain set at all, will be included in the results. See First-party isolation.
      name{{optional_inline}}
      A string representing a name that the cookies should have.
      path{{optional_inline}}
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/cookies/index.html b/files/en-us/mozilla/add-ons/webextensions/api/cookies/index.html index aa3db8270d766f4..1ff885c14482321 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/cookies/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/cookies/index.html @@ -15,11 +15,11 @@

      Enables extensions to get and set cookies, and be notified when they change.

      -

      To use this API, you need to include the "cookies" API permission in your manifest.json file, as well as host permissions for the sites whose cookies you need to access. See cookie Permissions.

      +

      To use this API, you need to include the "cookies" API permission in your manifest.json file, as well as host permissions for the sites whose cookies you need to access. See cookie Permissions.

      Permissions

      -

      In order to use this API, an add-on must specify the "cookies" API permission in its manifest, along with host permissions for any sites for which it wishes to access cookies. The add-on may read or write any cookies which could be read or written by a URL matching the host permissions. For example:

      +

      In order to use this API, an add-on must specify the "cookies" API permission in its manifest, along with host permissions for any sites for which it wishes to access cookies. The add-on may read or write any cookies which could be read or written by a URL matching the host permissions. For example:

      http://*.example.com/
      @@ -77,7 +77,7 @@

      First-party isolation

      When first-party isolation is on, cookies are further qualified by the domain of the original page the user visited (essentially, the domain shown to the user in the URL bar, also known as the "first party domain"). This means it's not possible for a tracker to correlate its cookie from bbc.com with its cookie from cnn.com, so the tracker can't track a single user across both sites.

      -

      First-party isolation can be enabled directly by the user by adjusting the browser's configuration, and can be set by extensions using the firstPartyIsolate setting in the privacy API. Note that first-party isolation is enabled by default in Tor Browser.

      +

      First-party isolation can be enabled directly by the user by adjusting the browser's configuration, and can be set by extensions using the firstPartyIsolate setting in the privacy API. Note that first-party isolation is enabled by default in Tor Browser.

      In the cookies API, the first party domain is represented using the firstPartyDomain attribute. All cookies set while first-party isolation is on will have this attribute set to the domain of the original page. In the example above, this would be "bbc.com" for one cookie and "cnn.com" for the other. All cookies set by websites while first-party isolation is off will have this property set to an empty string.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/cookies/remove/index.html b/files/en-us/mozilla/add-ons/webextensions/api/cookies/remove/index.html index 9990c1391e365b9..bfb9ad0f39710fd 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/cookies/remove/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/cookies/remove/index.html @@ -16,7 +16,7 @@

      The remove() method of the {{WebExtAPIRef("cookies")}} API deletes a cookie, given its name and URL.

      -

      The call succeeds only if you include the "cookies" API permission in your manifest.json file, as well as host permissions for the given URL specified in its manifest.

      +

      The call succeeds only if you include the "cookies" API permission in your manifest.json file, as well as host permissions for the given URL specified in its manifest.

      This is an asynchronous function that returns a Promise.

      @@ -35,13 +35,13 @@

      Parameters

      firstPartyDomain{{optional_inline}}
      -
      A string representing the first-party domain with which the cookie to remove is associated. This property must be supplied if the browser has first-party isolation enabled. See First-party isolation.
      +
      A string representing the first-party domain with which the cookie to remove is associated. This property must be supplied if the browser has first-party isolation enabled. See First-party isolation.
      name
      A string representing the name of the cookie to remove.
      storeId{{optional_inline}}
      A string representing the ID of the cookie store to find the cookie in. If unspecified, the cookie is looked for by default in the current execution context's cookie store.
      url
      -
      A string representing the URL associated with the cookie. If the extension does not have host permissions for this URL, the API call will fail.
      +
      A string representing the URL associated with the cookie. If the extension does not have host permissions for this URL, the API call will fail.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/cookies/samesitestatus/index.html b/files/en-us/mozilla/add-ons/webextensions/api/cookies/samesitestatus/index.html index 5977a5bfb167148..2576d5e7fc0c316 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/cookies/samesitestatus/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/cookies/samesitestatus/index.html @@ -30,4 +30,4 @@

      Type

      Corresponds to a cookie set with SameSite=Strict
      -

      See SameSite cookies for more information.

      +

      See SameSite cookies for more information.

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/cookies/set/index.html b/files/en-us/mozilla/add-ons/webextensions/api/cookies/set/index.html index f0863661c5f80bc..5bf1614a6916706 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/cookies/set/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/cookies/set/index.html @@ -16,7 +16,7 @@

      The set() method of the {{WebExtAPIRef("cookies")}} API sets a cookie containing the specified cookie data. This method is equivalent to issuing an HTTP Set-Cookie header during a request to a given URL.

      -

      The call succeeds only if you include the "cookies" API permission in your manifest.json file, as well as host permissions for the given URL specified in its manifest. The given URL also needs the necessary permissions to create a cookie with the given parameters.

      +

      The call succeeds only if you include the "cookies" API permission in your manifest.json file, as well as host permissions for the given URL specified in its manifest. The given URL also needs the necessary permissions to create a cookie with the given parameters.

      This is an asynchronous function that returns a Promise.

      @@ -39,7 +39,7 @@

      Parameters

      expirationDate{{optional_inline}}
      A number that represents the expiration date of the cookie as the number of seconds since the UNIX epoch. If omitted, the cookie becomes a session cookie.
      firstPartyDomain{{optional_inline}}
      -
      A string representing the first-party domain with which the cookie to will be associated. This property must be supplied if the browser has first-party isolation enabled. See First-party isolation.
      +
      A string representing the first-party domain with which the cookie to will be associated. This property must be supplied if the browser has first-party isolation enabled. See First-party isolation.
      httpOnly{{optional_inline}}
      A boolean that specifies whether the cookie should be marked as HttpOnly (true), or not (false). If omitted, it defaults to false.
      name{{optional_inline}}
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/devtools/index.html b/files/en-us/mozilla/add-ons/webextensions/api/devtools/index.html index c6703a76bca3861..e8302002f37bfe7 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/devtools/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/devtools/index.html @@ -15,7 +15,7 @@

      Enables extensions to interact with the browser's {{Glossary("Developer Tools")}}. You can use this API to create Developer Tools pages, interact with the window that is being inspected, inspect the page network usage.

      -

      To use this API you need to have the "devtools" API permission specified in your manifest.json file. This permission can not be optional.

      +

      To use this API you need to have the "devtools" API permission specified in your manifest.json file. This permission can not be optional.

      Interfaces

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/eval/index.html b/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/eval/index.html index 25634475b25189f..39be34562c6a2b7 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/eval/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/eval/index.html @@ -17,9 +17,9 @@

      This is somewhat like using {{WebExtAPIRef("tabs.executeScript()")}} to attach a content script, but with two main differences:

      -

      First, the JavaScript can use a set of special commands that browsers typically provide in their devtools console implementation: for example, using "$0" to refer to the element currently selected in the Inspector.

      +

      First, the JavaScript can use a set of special commands that browsers typically provide in their devtools console implementation: for example, using "$0" to refer to the element currently selected in the Inspector.

      -

      Second, the JavaScript you execute can see any changes made to the page by scripts that the page loaded. This is in contrast to content scripts, which see the page as it would exist if no page scripts were loaded. However, note that the isolation provided by content scripts is a deliberate security feature, intended to make it harder for malicious or uncooperative web pages to confuse or subvert WebExtensions APIs by redefining DOM functions and properties. This means you need to be very careful if you waive this protection by using eval(), and should use content scripts unless you need to use eval().

      +

      Second, the JavaScript you execute can see any changes made to the page by scripts that the page loaded. This is in contrast to content scripts, which see the page as it would exist if no page scripts were loaded. However, note that the isolation provided by content scripts is a deliberate security feature, intended to make it harder for malicious or uncooperative web pages to confuse or subvert WebExtensions APIs by redefining DOM functions and properties. This means you need to be very careful if you waive this protection by using eval(), and should use content scripts unless you need to use eval().

      The script is evaluated by default in the main frame of the page. The script must evaluate to a value that can be represented as JSON (meaning that, for example, it may not evaluate to a function or an object that contains any functions). By default, the script does not see any content scripts attached to the page.

      @@ -40,7 +40,7 @@

      Helpers

      Given an object, if it is an DOM element in the page, selects it in the devtools Inspector, otherwise it creates an object preview in the webconsole.
      -

      See some examples.

      +

      See some examples.

      Syntax

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/index.html b/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/index.html index b184c3d2c52d53f..36221967ee7ea73 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/devtools/inspectedwindow/index.html @@ -12,7 +12,7 @@
      {{AddonSidebar}}
      -

      This page describes the WebExtensions devtools APIs as they exist in Firefox 54. Although the APIs are based on the Chrome devtools APIs, there are still many features that are not yet implemented in Firefox, and therefore are not documented here. To see which features are currently missing please see Limitations of the devtools APIs.

      +

      This page describes the WebExtensions devtools APIs as they exist in Firefox 54. Although the APIs are based on the Chrome devtools APIs, there are still many features that are not yet implemented in Firefox, and therefore are not documented here. To see which features are currently missing please see Limitations of the devtools APIs.

      The devtools.inspectedWindow API lets a devtools extension interact with the window that the developer tools are attached to.

      @@ -22,16 +22,16 @@

      Properties

      -
      devtools.inspectedWindow.tabId
      +
      devtools.inspectedWindow.tabId
      The ID of the window that the developer tools are attached to.

      Functions

      -
      devtools.inspectedWindow.eval()
      +
      devtools.inspectedWindow.eval()
      Evaluate some JavaScript in the target window.
      -
      devtools.inspectedWindow.reload()
      +
      devtools.inspectedWindow.reload()
      Reload the target window's document.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/devtools/network/index.html b/files/en-us/mozilla/add-ons/webextensions/api/devtools/network/index.html index e6cd85729926e8a..1a55965097bf62a 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/devtools/network/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/devtools/network/index.html @@ -18,16 +18,16 @@

      Functions

      -
      devtools.network.getHAR()
      +
      devtools.network.getHAR()
      Get a HAR log for the page loaded in the current tab.

      Events

      -
      devtools.network.onNavigated
      +
      devtools.network.onNavigated
      Fired when the user navigates the inspected window to a new page.
      -
      devtools.network.onRequestFinished
      +
      devtools.network.onRequestFinished
      Fired when the a network request has finished and its details are available to the extension.
      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/index.html b/files/en-us/mozilla/add-ons/webextensions/api/index.html index a3470b07b824f0d..e051e7d6f0c5b42 100644 --- a/files/en-us/mozilla/add-ons/webextensions/api/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/api/index.html @@ -7,34 +7,34 @@
      {{AddonSidebar}}
      -

      JavaScript APIs for WebExtensions can be used inside the extension's background scripts and in any other documents bundled with the extension, including browser action or page action popups, sidebars, options pages, or new tab pages. A few of these APIs can also be accessed by an extension's content scripts. (See the list in the content script guide.)

      +

      JavaScript APIs for WebExtensions can be used inside the extension's background scripts and in any other documents bundled with the extension, including browser action or page action popups, sidebars, options pages, or new tab pages. A few of these APIs can also be accessed by an extension's content scripts. (See the list in the content script guide.)

      -

      To use the more powerful APIs, you need to request permission in your extension's manifest.json.

      +

      To use the more powerful APIs, you need to request permission in your extension's manifest.json.

      You can access the APIs using the browser namespace:

      -
      function logTabs(tabs) {
      -  console.log(tabs)
      -}
      +
      function logTabs(tabs) {
      +  console.log(tabs)
      +}
       
      -browser.tabs.query({currentWindow: true}, logTabs)
      +browser.tabs.query({currentWindow: true}, logTabs)

      Many of the APIs are asynchronous, returning a {{JSxRef("Promise")}}:

      -
      function logCookie(c) {
      -  console.log(c)
      -}
      +
      function logCookie(c) {
      +  console.log(c)
      +}
       
      -function logError(e) {
      -  console.error(e)
      -}
      +function logError(e) {
      +  console.error(e)
      +}
       
      -let setCookie = browser.cookies.set(
      -  {url: "https://developer.mozilla.org/"}
      -);
      -setCookie.then(logCookie, logError)
      +let setCookie = browser.cookies.set( + {url: "https://developer.mozilla.org/"} +); +setCookie.then(logCookie, logError)
      @@ -54,7 +54,7 @@

      Examples 

      For example, here is the first code example on this page running in the Toolbox console in Firefox Developer Edition:

      -

      Illustration of a snippet of web extension code run from the console in the Toolbox

      +

      Illustration of a snippet of web extension code run from the console in the Toolbox

      JavaScript API listing

      diff --git a/files/en-us/mozilla/add-ons/webextensions/api/javascript_exercised_in_console.jpg b/files/en-us/mozilla/add-ons/webextensions/api/javascript_exercised_in_console.jpg new file mode 100644 index 000000000000000..bfdea7dca6d0651 Binary files /dev/null and b/files/en-us/mozilla/add-ons/webextensions/api/javascript_exercised_in_console.jpg differ diff --git a/files/en-us/mozilla/add-ons/webextensions/index.html b/files/en-us/mozilla/add-ons/webextensions/index.html index dc6ee5aeba4d23b..b93b0e787c0a136 100644 --- a/files/en-us/mozilla/add-ons/webextensions/index.html +++ b/files/en-us/mozilla/add-ons/webextensions/index.html @@ -10,7 +10,7 @@

      Extensions, or add-ons, can modify and enhance the capability of a browser. Extensions for Firefox are built using the WebExtensions API cross-browser technology.

      -

      The technology for extensions in Firefox is, to a large extent, compatible with the extension API supported by Chromium-based browsers (such as Google Chrome, Microsoft Edge, Opera, Vivaldi). In most cases, extensions written for Chromium-based browsers run in Firefox with just a few changes.

      +

      The technology for extensions in Firefox is, to a large extent, compatible with the extension API supported by Chromium-based browsers (such as Google Chrome, Microsoft Edge, Opera, Vivaldi). In most cases, extensions written for Chromium-based browsers run in Firefox with just a few changes.

      Key resources

      @@ -35,7 +35,7 @@

      Get started

      Concepts

      -

      Get detailed information on the concept that underpin extensions from an overview of the JavaScript API, through content scripts, match patterns, working with files, internationalization, and content security policy, to more advanced subjects such as native messaging, using the devtools APIs, and native manifests.

      +

      Get detailed information on the concept that underpin extensions from an overview of the JavaScript API, through content scripts, match patterns, working with files, internationalization, and content security policy, to more advanced subjects such as native messaging, using the devtools APIs, and native manifests.

      User interface