Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs for getting token for origin trial #2885

Merged
merged 23 commits into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 7 additions & 86 deletions microsoft-edge/origin-trials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,99 +5,20 @@ author: MSEdgeTeam
ms.author: msedgedevrel
ms.topic: conceptual
ms.prod: microsoft-edge
ms.date: 02/02/2023
ms.date: 10/20/2023
---
# Use Origin Trials in Microsoft Edge

You can use Origin Trials to try out experimental APIs on live sites for a limited period of time. When using Origin Trials, users of Microsoft Edge that visit your site may run code that uses experimental APIs. To access the experimental APIs on each user machine, you don't need to go to `edge://flags` and turn on feature flags. Instead, you register the origin (for example, `https://www.contoso.com:443`) that you want to use the experimental feature on, and you'll then be sent a token that you add to the code of your website.
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

You can use Origin Trials to try out experimental APIs on live sites for a limited period of time. When using Origin Trials, users of Microsoft Edge that visit your site may run code that uses experimental APIs. To access the experimental APIs on each user machine, you don't need to go to `edge://flags` and turn on feature flags.
To see a list of the available origin trials and register your origin to give them a try, see [Microsoft Edge Origin Trials](https://microsoftedge.github.io/MSEdgeExplainers/origin-trials/). To assess the suitability of using the experimental APIs on your website, check the minimum version requirements for Microsoft Edge, and the trial end date.

Instead, you register the origin (for example, `https://www.contoso.com:443`) that you want to use the experimental feature on and you'll be issued a token that you add to the code of your website.
You can also provide feedback to browser engineers and the web standards community about the design of the API, your use cases, or your experience using the APIs.

To see a list of the available origin trials and register your origin to give them a try, see the [Microsoft Edge Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials/). You can also provide feedback to browser engineers and the web standards community about the design of the API, your use cases, or your experience using the APIs.
For more information, see the **Getting Started** section in [Microsoft Edge Origin Trials](https://microsoftedge.github.io/MSEdgeExplainers/origin-trials/).
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved


<!-- ====================================================================== -->
## Get started using Origin Trials
## See also

For more information about the experimental APIs available in Microsoft Edge, see [Microsoft Edge Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials). Be sure to review the minimum version requirements for Microsoft Edge, and the trial end date, to assess the suitability of using the experimental APIs on your website.

> [!NOTE]
> An experiment may end earlier than planned if any of the following situations occur:
> * A major security incident.
> * If sufficient feedback is collected that indicates a major redesign is needed to meet the needs of web developers.
> In either case, a notification email is sent to all developers currently enrolled in the experiment.

### Register for a trial of an experimental API

To register for a trial of an experimental API:

1. Go to [Microsoft Edge Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials).

1. Click the **Register** button on any of the available experiments.

1. Sign in to the Developer Console using your GitHub username and password.

1. Click **Authorize MicrosoftEdge**.

1. Complete the form.

> [!NOTE]
> To enroll a single or all subdomains, choose set the `Do you need to match all subdomains for the provided origin?` setting to `Yes`. For example, `https://dev.contoso.com` is a single domain, and `https://*.contoso.com` uses a wildcard to represent all subdomains.

> [!IMPORTANT]
> The following origin formats aren't allowed.
> * Specifying a subfolder on the origin. For example, `https://contoso.com/path/subfolder`
>
> * Using an origin with query string parameters. For example, `https://contoso.com/path/feature?query_parameter=12345`

1. Click **ACCEPT and REGISTER**.

### Apply your token

A token is instantly generated and displayed on the [Microsoft Edge Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials). To begin using the trial on your website, use either of the following methods to apply the token to your page:

* Add the `origin-trial` attribute value and your token to the `meta` tag on every page that uses the experimental API.

```html
<meta http-equiv="origin-trial" content="replace-with-your-token">
```

* Add `Origin-Trial` to the HTTP response header of your server.

```json
Origin-Trial: replace-with-your-token
```

> [!NOTE]
> Your token is valid for 6 weeks. Before your trial ends, reminder emails are sent to you that ask for your feedback and ask you to consider renewing your trial before your token expires.

### Opt out of an experiment

To opt out of an experiment, use one of the following methods to remove your token.

* Remove the `meta` tag from every page that used the experimental API.

```html
<meta http-equiv="origin-trial" content="your-token">
```

* Remove `Origin-Trial` from the HTTP response header of your server.

```json
Origin-Trial: your-token
```

### Detect experimental features and provide a fallback

When using experimental APIs, ensure you provide a working experience to all visitors of your website. Visitors may use browsers that don't support the experimental APIs that you added to your code. Additionally, if your token expires before you renew it, the experimental API is no longer available, which may result in errors.

To avoid this situation, make sure you detect features available in your browser. For more information, see [Implementing feature detection](https://developer.mozilla.org/docs/learn/tools_and_testing/cross_browser_testing/feature_detection).

### Roadmap for Allowed Origins

The Microsoft Edge Origin Trials portal today only supports SSL Enabled Origins, which means that websites must have HTTPS properly implemented to register for an experiment. In the future, the following secure origins are planned:

* Register `http://localhost` as the origin for your experiments. To use `http://localhost` today, go to `edge://flags` and set the experiment to **Enabled**.

* Use extensions with `extensions://` prefixed origins to enroll in experiments.
* [Experimental features and origin trials](../progressive-web-apps-chromium/how-to/origin-trials.md) in the Progressive Web Apps (PWA) docs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Native applications on many operating systems can handle links. Native applicati
Progressive Web Apps (PWAs) can also handle links in a similar way.


<!-- although the present filename is handle-urls.md, this file was repurposed to cover link handling rather than URL handlers. see also [PWAs as URL Handlers](https://web.dev/pwa-url-handler/) -->
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved


<!-- ====================================================================== -->
## Automatic link handling

Expand Down Expand Up @@ -49,4 +52,4 @@ Once the feature can be used in Microsoft Edge, we will document it here. In the
<!-- ====================================================================== -->
## See also

* [PWAs as URL Handlers](https://web.dev/pwa-url-handler/).
* [PWAs as URL Handlers](https://web.dev/pwa-url-handler/)
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,38 @@ ms.author: msedgedevrel
ms.topic: conceptual
ms.prod: microsoft-edge
ms.technology: pwa
ms.date: 11/25/2022
ms.date: 10/20/2023
---
# Experimental features and origin trials

Some of the PWA features in Microsoft Edge are still experimental. Experimental features can be used in two ways:
Some of the PWA features in Microsoft Edge are still experimental. Experimental features can be used in either of two ways:

* By enabling the corresponding flag in Microsoft Edge.
* By enrolling your site in an origin trial to test features in production with your users.
* By enabling the corresponding flag in Microsoft Edge.
* By enrolling your site in an origin trial to test features in production with your users.


<!-- ====================================================================== -->
## Toggle experimental features

To turn experimental features on or off:

1. Open Microsoft Edge.
1. Go to `edge://flags`.
1. Navigate to the relevant experiment.
1. Select the dropdown menu next to the experiment description and select **Enabled** to turn on the feature or **Disabled** to turn it off.
1. Open Microsoft Edge.
1. Go to `edge://flags`.
1. Navigate to the relevant experiment.
1. In the dropdown menu next to the experiment description, select **Enabled** to turn on the feature, or **Disabled** to turn it off:

![Select Enabled to turn on an experiment](./origin-trials-images/turn-on-experimental-flag.png)
![Select Enabled to turn on an experiment](./origin-trials-images/turn-on-experimental-flag.png)


<!-- ====================================================================== -->
## Enroll your site in an origin trial

Microsoft Edge sometimes uses origin trials to test features for specific domains or websites. You may want to use an origin trial for your website to apply a specific feature. If you're a website owner, you can enroll in an origin trial. An origin trial provides features to a percentage of Microsoft Edge users who visit your website.

For more information about Origin Trials, see [Microsoft Edge Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials).
For more information, see [Microsoft Edge Origin Trials](https://microsoftedge.github.io/MSEdgeExplainers/origin-trials/).


<!-- ====================================================================== -->
## See also

* [Use Origin Trials in Microsoft Edge](../../origin-trials/index.md)
14 changes: 8 additions & 6 deletions microsoft-edge/progressive-web-apps-chromium/whats-new/pwa.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,18 +252,20 @@ Learn more in [Publish a Progressive Web App to the Microsoft Store](../how-to/m

To have more control over the title bar area that's currently displayed in standalone display mode, you may want to experiment with Window Controls Overlay. Window Controls Overlay (WCO) is a set of features that work together to provide just the essential controls needed for the app window. This layout frees up more space for the web content layer. WCO is available for installed desktop PWAs.

Learn more about experimenting with Window Controls Overlay at [Experimental features in Progressive Web Apps (PWAs)](../how-to/window-controls-overlay.md).
Learn more about experimenting with Window Controls Overlay at [Display content in the title bar](../how-to/window-controls-overlay.md).

Register your origin for the **Web App Window Controls Overlay** trial at our [Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials/web-app-window-controls-overlay/registration/).
Register your origin for the **Web App Window Controls Overlay** trial at our [Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials/web-app-window-controls-overlay/registration/).<!-- todo: update per https://microsoftedge.github.io/MSEdgeExplainers/origin-trials/ -->
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved


#### URL Handlers origin trial

Developers can now use the experimental feature Web App URL Handlers in origin trial. This feature allows the registration of an installed PWA to open links from other apps that refer to its scope.

Learn more about experimenting with URL handlers at [Experimental features in Progressive Web Apps (PWAs)](../how-to/handle-urls.md).
Register your domain for the **Web App URL Handlers** trial at our [Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials/web-app-url-handlers/registration/).<!-- todo: update per https://microsoftedge.github.io/MSEdgeExplainers/origin-trials/ -->
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

Register your domain for the **Web App URL Handlers** trial at our [Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials/web-app-url-handlers/registration/).
See also:
* [Handle links to your Progressive Web Apps](../how-to/handle-urls.md)
* [PWAs as URL Handlers](https://web.dev/pwa-url-handler/)


#### Support for the Share API on macOS
Expand All @@ -281,9 +283,9 @@ Microsoft Edge version 92 became the stable channel of Microsoft Edge on July 22

#### Protocol handlers origin trial

You can now register your PWA to handle specific protocols with the host operating system. The Windows trial for protocol handlers is now available. You can register your origin for the **Web App Protocol Handler** trial at the [origin trial signup page](https://developer.microsoft.com/microsoft-edge/origin-trials/web-app-protocol-handler-registration/registration).
You can now register your PWA to handle specific protocols with the host operating system. The Windows trial for protocol handlers is now available. You can register your origin for the **Web App Protocol Handler** trial at the [origin trial signup page](https://developer.microsoft.com/microsoft-edge/origin-trials/web-app-protocol-handler-registration/registration).<!-- todo: update per https://microsoftedge.github.io/MSEdgeExplainers/origin-trials/ -->
mikehoffms marked this conversation as resolved.
Show resolved Hide resolved

Learn more about using protocol handlers with your PWA at [Experimental features in Progressive Web Apps (PWAs)](../how-to/handle-protocols.md).
Learn more about using protocol handlers with your PWA at [Handle protocols in Progressive Web Apps](../how-to/handle-protocols.md).


#### Streamlined App Info menu
Expand Down
3 changes: 2 additions & 1 deletion microsoft-edge/test-and-automation/test-and-automation.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ See [DevTools Protocol](devtools-protocol.md).

You can use Origin Trials to try out experimental APIs on live sites for a limited period of time. When using Origin Trials, users of Microsoft Edge that visit your site may run code that uses experimental APIs. To access the experimental APIs on each user machine, you don't need to go to `edge://flags` and turn on feature flags.

To see a list of the available origin trials and register your origin to give them a try, see the [Microsft Edge Origin Trials Developer Console](https://developer.microsoft.com/microsoft-edge/origin-trials/). You can also provide feedback to browser engineers and the web standards community about the design of the API, your use cases, or your experience using the APIs.
To see a list of the available origin trials and register your origin to give them a try, see [Microsoft Edge Origin Trials](https://microsoftedge.github.io/MSEdgeExplainers/origin-trials/). You can also provide feedback to browser engineers and the web standards community about the design of the API, your use cases, or your experience using the APIs.


<!-- ====================================================================== -->
## Playwright
Expand Down
16 changes: 15 additions & 1 deletion microsoft-edge/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@

- name: Get started with PWAs
href: progressive-web-apps-chromium/how-to/index.md
displayName: Get started with Progressive Web Apps # top-of-page title

- name: Best practices for PWAs
href: progressive-web-apps-chromium/how-to/best-practices.md
Expand All @@ -1053,6 +1054,7 @@

- name: Publish PWAs to the Microsoft Store
href: progressive-web-apps-chromium/how-to/microsoft-store.md
displayName: Publish a Progressive Web App to the Microsoft Store # top-of-page title

- name: Experimental features and origin trials
href: progressive-web-apps-chromium/how-to/origin-trials.md
Expand All @@ -1068,9 +1070,11 @@

- name: Web app manifest
href: progressive-web-apps-chromium/how-to/web-app-manifests.md
displayName: Use a web app manifest to integrate a Progressive Web App into the operating system # top-of-page title

- name: Service Workers
href: progressive-web-apps-chromium/how-to/service-workers.md
displayName: Use Service Workers to manage network requests # top-of-page title

- name: Store data on the device
href: progressive-web-apps-chromium/how-to/offline.md
Expand All @@ -1088,37 +1092,47 @@

- name: Synchronize and update in the background
href: progressive-web-apps-chromium/how-to/background-syncs.md
displayName: Synchronize and update a PWA in the background # top-of-page title

- name: Handle files
href: progressive-web-apps-chromium/how-to/handle-files.md
displayName: Handle files in Progressive Web Apps # top-of-page title

- name: Handle URLs
href: progressive-web-apps-chromium/how-to/handle-urls.md
displayName: Handle links to your Progressive Web Apps # top-of-page title

- name: Handle protocols
href: progressive-web-apps-chromium/how-to/handle-protocols.md
displayName: Handle protocols in Progressive Web Apps # top-of-page title

- name: Display content in the title bar
href: progressive-web-apps-chromium/how-to/window-controls-overlay.md
displayName:

- name: Share content with other apps
href: progressive-web-apps-chromium/how-to/share.md
displayName:

- name: Define app shortcuts
href: progressive-web-apps-chromium/how-to/shortcuts.md
displayName:

- name: Build operating system Widgets
href: progressive-web-apps-chromium/how-to/widgets.md
displayName: Build PWA-driven widgets # top-of-page title

- name: Build PWAs for the sidebar in Microsoft Edge
href: progressive-web-apps-chromium/how-to/sidebar.md
displayName:

- name: What's new
href: progressive-web-apps-chromium/whats-new/pwa.md
displayName: release notes, announcements
displayName: release notes, announcements, What's New in Progressive Web Apps # top-of-page title

- name: Progressive Web App demos
href: progressive-web-apps-chromium/demo-pwas.md
displayName:

# =============================================================================
# if top-of-page title is longer, add it to displayName comma-delimited list of lookup keywords
Expand Down