As web developers, we're always eager to explore the latest and greatest features that can enhance user experiences and push the boundaries of what's possible on the web. Microsoft Edge offers a unique opportunity to do just that through Origin Trials. This article will guide you through the process of using origin trials in Microsoft Edge, allowing you to safely experiment with experimental APIs on your live website for a limited time.
Origin trials provide a controlled environment to test new and upcoming web platform features. They allow developers to:
Essentially, origin trials bridge the gap between browser development and real-world web application usage, ensuring new features are robust and meet the needs of developers.
The origin-trials mechanism empowers users of your webpage to experience experimental feature APIs in their Microsoft Edge browser, even if the feature is disabled by default. Here's how it works:
<head>
section as a <meta>
tag or as an HTTP header in your server response.In short, the origin trial token acts as a key that unlocks the experimental feature for users visiting your site with Microsoft Edge.
Getting started with origin trials involves a simple registration process:
Visit the Microsoft Edge Origin Trials page: Go to the Microsoft Edge Origin Trials portal (External link to Microsoft Edge Origin Trials).
Select an Active Trial: Browse the list of available trials and choose the one you're interested in. Note that some trials, like the Ad Selection API, may have a separate sign-up process (link to: Sign up for the Ad Selection API).
Accept the Terms of Use: Click the "I Accept the Terms of Use" button.
Sign In (If Prompted): You may need to sign in with a GitHub account or another authentication method.
Complete the Registration Form: The "New Origin Trial Registration" form will appear. Enter the domain or subdomain you want to use for the trial.
Configure Subdomain Support: Use the "Enable token for subdomains?" toggle to specify whether the token should be valid for the main domain only or for the domain and all its subdomains.
https://example.com
(subdomains like https://beta.example.com
are not supported). Toggle OFF.https://beta.example.com
(the main domain https://example.com
is not supported). Toggle OFF.https://example.com
and https://beta.example.com
are supported. Toggle ON.Submit: Click the "Submit" button.
Copy the Token: The generated origin trial token will be displayed. Click the "Copy" button and store the token securely.
Once you have your token, you need to integrate it into your website. You have two options:
Option 1: Meta Tag in the <head>
Add the following <meta>
tag within the <head>
section of your HTML:
<meta http-equiv="origin-trial" content="YOUR_TOKEN_HERE">
Replace YOUR_TOKEN_HERE
with the actual token you copied.
Option 2: HTTP Header in Server Response
Configure your web server to include the following HTTP header in its response:
Origin-Trial: YOUR_TOKEN_HERE
Again, replace YOUR_TOKEN_HERE
with your token.
<meta>
tag or HTTP header.localhost
. To test locally, you'll need to enable the corresponding feature flag in edge://flags
.Your feedback is essential to the success of origin trials and the development of new web standards. Microsoft encourages you to share your experiences and insights:
Microsoft Edge Origin Trials offer a fantastic opportunity for web developers to explore the cutting edge of web technology, influence the future of the web platform, and provide exceptional experiences for their users. By following the steps outlined in this article and actively participating in the feedback process, you can play a vital role in shaping the evolution of the web.