Author: Zouhir Chahoud
The Origin Trials framework is a great way for Web developers to connect with browser engineers and the Web standards community, it enables Web developers to experiment in new web platform capabilities and offers a medium where they can continuously provide feedback on various APIs shape, usability and effectiveness after experimenting with them for a limited period of time in real production sites.
Once you have registered your website for an experiment, you will be able to use the experimental API without requiring your beta testers to turn a feature flag in edge://flags.
You can visit the Edge Origin Trials Developer Console to see a list of the experimental APIs Edge browser engineers are offering and would like to you try and give them feedback on.
Our framework is consistent with Chrome Origin Trials, simply click the register
button for any of the available experiments in our Origin Trials Developer console, provide your website's origin, and we will instantly generate a token once you agree to our terms and conditions and submit the form.
There are 2 ways to use the tokens provide in your page:
Add an origin-trial tag to the head of any page, example:
<meta http-equiv="origin-trial" content="your-token-gues-here">
Another option is to add Origin-Trial
to your HTTP server response headers, example:
Origin-Trial: your-token-goes-here
The Edge Origin Trials portal today only supports SSL Enabled Origins, websites wanting to register for an experiment must have HTTPS
properly implemented. However, in future portal releases we are looking to enable more secure origins such as:
- Localhost: it's going to be possible to register
http://localhost
in experiments, today developer can enable the appropriate feature flag in edge://flags. - Extensions: it's going to be possible for
extensions://
prefixed origins to enroll in experiments.
It is possible to only enroll a specific subdomain such as https://dev.example.com
or an origin with wild-card match to all it's subdomains by answering Yes to the "Do you need to match all subdomains for the provided origin?" question in the Microsoft Edge Origin Trials Developer Console. However, the following scenarios are not possible:
https://example.com/path/new-feature
https://example.com/path/new-feature?test_id=12345
Once you have registered for a trial, your token will be valid for 6 weeks, which this is the standard duration for a trial cycle, and the end of each cycle, you are eligible to renew after providing your feedback on the API you are experimenting with.
We will send out emails reminding you to provide feedback and renew before your token expires.
The duration of an experiment is usually longer than 6 weeks, the standard duration for a trial cycle. When browsing available experiments you will be able to see which versions of Edge the experiment will be available for as well as the estimated end date.
NOTE
To opt out of an experiment, you can simply remove the token we have provided from your page's HEAD meta
tag or server's response HTTP header.
MDN has a great resource on best practices for feature detection, you can view it here. In summary, it is important to always provide a working experience if the feature your website is using does not exist in the browser your visitor is running, this is extremely applicable when relying on an experimental feature using a token that needs to be renewed every 6 weeks.