 Well, these are a way for developers to test an experimental web platform feature and for the Chrome team to get feedback and rapidly iterate design. Origin trials allow Chrome to make an experimental feature available for a limited time to get feedback, but only to sites that opt into trying it out. Now, that enables web developers to test experimental features in production with real users and, you know, not just their developer team, but it also allows Chrome engineers to quickly iterate feature design in response to feedback. And just in case you're wondering, when I say origin trial feature, well, I mean a change in the web platform, and that could be a new HTML element, new CSS feature or new JavaScript API, or some other change to the way the browser presents websites to users. So I'm Sam Dutton, a developer advocate with the Google Chrome team, and in this video I won't get too deep technically, but you'll learn how origin trials work and how you can use them to try out new features. Of course, you can enable new or experimental features by setting Chrome flags, but you know, that only works for a single user, and you can find out more about that from our video, Chrome flags. But you know, if you want to do field testing with lots of real users on your site without needing them to do anything special, well, that's where origin trials come in handy. To take part in a trial, you need to provide a valid token for the trial on every page where you want to use the trial feature. In case you're wondering, a token is just a string of numbers and letters that encodes the name of the feature in the trial, the trial expiry date, the website the token is valid for, and some other information. And for the techies out there, where you can see what's in the string just by base 64 decoding it. Now, you can check this out by entering your token string at the site otdecode.glitch.me. So to get a token, well, you first need to register for a trial and fill in the details. Now straight away, you can copy the token value. You then need to make that token available on every page where you want to access the trial feature. You can do that by adding a tag in the page code as an HTTP header, or by providing a token programmatically, you know, with JavaScript. So how do tokens magically get the browser to turn on trial features? Well, as soon as you open a web page, Chrome checks for origin trial tokens. If Chrome finds a token, it decodes it, does some checks to test if the token is valid, you know, it hasn't expired, and to see if the origin for the token matches the current web page. And if all goes well, the feature is enabled and can be used. As well as using Chrome DevTools, you know, you can also check origin trial tokens using our origin trial extension. If the token expires, you'll get an email with a renewal link. Once you've started using an origin trial feature, you'll need to give feedback. You can do this from the origin trial page for the feature you're testing. Feedback is shared with a small number of Chrome staff working on the feature and will only be shared publicly in an aggregated or anonymized format. If anything is blocking you from experimenting with the API, then, you know, ask a question about your implementation, or I don't know, to ask something about documentation by using that feedback feature. There are several other ways, though, to provide feedback and engage in discussion publicly. If you want to comment on the design of the API in an origin trial, file an issue on the API explainer. The example here I'm using is the Fed-CM trial. And for bugs and issues with the implementation of the feature in Chrome, first take a look at existing features, and then, if necessary, create a new bug report. Now, sometimes you might want to test a trial feature on lots of different sites that can embed your JavaScript to allow certain functions or experiences. In other words, in a third-party context. Now, in theory, you could get lots of sites to agree to include a token to enable the feature you want to test. But of course, that just won't scale well. Now, what you need to do is to be able to inject a token on all the pages where you want to run your code. And this is called a third-party origin trial. Third-party origin trials make it possible for providers of embedded content to try out a new feature across multiple sites by providing a token using JavaScript. To take part in an origin trial in third-party contexts, make sure to select the third-party matching checkbox when you register for a trial. Now, you can add code to inject an origin trial token in the JavaScript you provide as a third-party. And by the way, not all origin trials are for testing new APIs. Some trials allow a deprecated feature to be temporarily re-enabled. And these are known as deprecation trials. For example, from Chrome 85, AppCache was no longer available in Chrome by default. But sites needing extra time to migrate off AppCache could register for the deprecation trial to continue using AppCache until Chrome 93. It's also worth remembering that not all features that go into an origin trial get shipped. AppCache is actually a good example of a feature that very likely would not have shipped in stable browsers if origin trials had been available at the time it was introduced. Problems with the design of AppCache were discovered once it was used on production sites in stable browsers. The problems, well, they would have been identified in an origin trial. But sadly, origin trials hadn't yet been invented by then. Anyway, one last thing, just because your pages provide a valid token for an origin trial doesn't always mean the trial feature is definitely supported. Some trials are not rolled out to all users. And for some trials, only a small percentage of users are actually in the experimental group for which the trial features can be activated. Also bear in mind that some users may have browser settings that mean the feature cannot be activated. And of course, it's likely that some of your users just won't have the right browser version. So make sure to check availability from the trial registration page, but also use feature detection every time to test if a trial feature is supported before attempting to use it. So that's Chrome origin trials. To find out more, take a look at our article on developer.chrome.com. And that also links to demos of the different ways to provide an origin trial token. It shows how to use Chrome DevTools to check tokens and provides a troubleshooting checklist. So thanks for watching and be sure to check out the other videos in the Chrome Concepts series.