<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>https://web.dev/</id>
  <title>Artur Janc on web.dev</title>
  <updated>2026-04-15T23:21:06Z</updated>
  <author>
    <name>Artur Janc</name>
  </author>
  <link href="https://web.dev/authors/arturjanc/feed.xml" rel="self"/>
  <link href="https://web.dev/"/>
  <icon>https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/hwvmzV4b6VQpTNrNF3wK.jpg?auto=format</icon>
  <logo>https://web.dev/images/shared/rss-banner.png</logo>
  <subtitle>Our latest news, updates, and stories by Artur Janc.</subtitle>
  
  
  <entry>
    <title>Security headers quick reference</title>
    <link href="https://web.dev/security-headers/"/>
    <updated>2021-05-18T00:00:00Z</updated>
    <id>https://web.dev/security-headers/</id>
    <content type="html" mode="escaped">&lt;p&gt;This article lists the most important security headers you can use to protect
your website. Use it to understand web-based security features, learn how to
implement them on your website, and as a reference for when you need a reminder.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;Security headers recommended for websites that handle sensitive user data:&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#csp&quot;&gt;Content Security Policy (CSP)&lt;/a&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#tt&quot;&gt;Trusted Types&lt;/a&gt;&lt;/dd&gt;
&lt;dt&gt;Security headers recommended for all websites:&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#xcto&quot;&gt;X-Content-Type-Options&lt;/a&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#xfo&quot;&gt;X-Frame-Options&lt;/a&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#corp&quot;&gt;Cross-Origin Resource Policy (CORP)&lt;/a&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#coop&quot;&gt;Cross-Origin Opener Policy (COOP)&lt;/a&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#hsts&quot;&gt;HTTP Strict Transport Security (HSTS)&lt;/a&gt;&lt;/dd&gt;
&lt;dt&gt;Security headers for websites with advanced capabilities:&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#cors&quot;&gt;Cross-Origin Resource Sharing (CORS)&lt;/a&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;a href=&quot;https://web.dev/security-headers/#coep&quot;&gt;Cross-Origin Embedder Policy (COEP)&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;details&gt;
&lt;summary&gt;
  Known threats on the web
  &lt;p class=&quot;text-base color-core-text gap-top-base&quot;&gt; Before diving into security headers, learn about known threats on the web and why you&#39;d want to use these security headers.&lt;/p&gt;
&lt;/summary&gt;
&lt;p&gt;Before diving into security headers, learn about known threats on the web
and why you&#39;d want to use these security headers.&lt;/p&gt;
&lt;h3 id=&quot;protect-your-site-from-injection-vulnerabilities&quot;&gt;Protect your site from injection vulnerabilities &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#protect-your-site-from-injection-vulnerabilities&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Injection vulnerabilities arise when untrusted data processed by your
application can affect its behavior and, commonly, lead to the execution of
attacker-controlled scripts. The most common vulnerability caused by injection
bugs is &lt;a href=&quot;https://portswigger.net/web-security/cross-site-scripting&quot; rel=&quot;noopener&quot;&gt;cross-site
scripting&lt;/a&gt; (XSS) in
its various forms, including &lt;a href=&quot;https://portswigger.net/web-security/cross-site-scripting/reflected&quot; rel=&quot;noopener&quot;&gt;reflected
XSS&lt;/a&gt;,
&lt;a href=&quot;https://portswigger.net/web-security/cross-site-scripting/stored&quot; rel=&quot;noopener&quot;&gt;stored XSS&lt;/a&gt;,
&lt;a href=&quot;https://portswigger.net/web-security/cross-site-scripting/dom-based&quot; rel=&quot;noopener&quot;&gt;DOM-based
XSS&lt;/a&gt;, and
other variants.&lt;/p&gt;
&lt;p&gt;An XSS vulnerability can typically give an attacker complete access to user data
processed by the application and any other information hosted in the same &lt;a href=&quot;https://web.dev/same-site-same-origin/#origin&quot;&gt;web
origin&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Traditional defenses against injections include consistent use of autoescaping
HTML template systems, avoiding the use of &lt;a href=&quot;https://domgo.at/cxss/sinks&quot; rel=&quot;noopener&quot;&gt;dangerous JavaScript
APIs&lt;/a&gt;, and properly processing user data by hosting
file uploads in a separate domain and sanitizing user-controlled HTML.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#csp&quot;&gt;Content Security Policy (CSP)&lt;/a&gt; to control which scripts can be
executed by your application to mitigate the risk of injections.&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#tt&quot;&gt;Trusted Types&lt;/a&gt; to enforce sanitization of data passed into dangerous
JavaScript APIs.&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#xcto&quot;&gt;X-Content-Type-Options&lt;/a&gt; to prevent the browser from
misinterpreting the MIME types of your website&#39;s resources, which can lead to
script execution.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;isolate-your-site-from-other-websites&quot;&gt;Isolate your site from other websites &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#isolate-your-site-from-other-websites&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The openness of the web allows websites to interact with each other in ways that
can violate an application&#39;s security expectations. This includes unexpectedly
making authenticated requests or embedding data from another application in the
attacker&#39;s document, allowing the attacker to modify or read application data.&lt;/p&gt;
&lt;p&gt;Common vulnerabilities that undermine web isolation include
&lt;a href=&quot;https://portswigger.net/web-security/clickjacking&quot; rel=&quot;noopener&quot;&gt;clickjacking&lt;/a&gt;, &lt;a href=&quot;https://portswigger.net/web-security/csrf&quot; rel=&quot;noopener&quot;&gt;cross-site
request forgery&lt;/a&gt; (CSRF), &lt;a href=&quot;https://www.scip.ch/en/?labs.20160414&quot; rel=&quot;noopener&quot;&gt;cross-site
script inclusion&lt;/a&gt; (XSSI), and various
&lt;a href=&quot;https://xsleaks.dev/&quot; rel=&quot;noopener&quot;&gt;cross-site leaks&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#xfo&quot;&gt;X-Frame-Options&lt;/a&gt; to prevent your documents from being embedded by a
malicious website.&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#corp&quot;&gt;Cross-Origin Resource Policy (CORP)&lt;/a&gt; to prevent your website&#39;s
resources from being included by a cross-origin website.&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#coop&quot;&gt;Cross-Origin Opener Policy (COOP)&lt;/a&gt; to protect your website&#39;s
windows from interactions by malicious websites.&lt;/li&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#cors&quot;&gt;Cross-Origin Resource Sharing (CORS)&lt;/a&gt; to control access to your
website&#39;s resources from cross-origin documents.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href=&quot;https://www.w3.org/TR/post-spectre-webdev/&quot; rel=&quot;noopener&quot;&gt;Post-Spectre Web
Development&lt;/a&gt; is a great read
if you are interested in these headers.&lt;/p&gt;
&lt;h3 id=&quot;build-a-powerful-website-securely&quot;&gt;Build a powerful website securely &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#build-a-powerful-website-securely&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://ieeexplore.ieee.org/document/8835233&quot; rel=&quot;noopener&quot;&gt;Spectre&lt;/a&gt; puts any data loaded
into the same &lt;a href=&quot;https://web.dev/why-coop-coep/&quot;&gt;browsing context group&lt;/a&gt; potentially readable
despite &lt;a href=&quot;https://web.dev/same-origin-policy/&quot;&gt;same-origin policy&lt;/a&gt;. Browsers restrict features
that may possibly exploit the vulnerability behind a special environment called
&amp;quot;&lt;a href=&quot;https://web.dev/coop-coep/&quot;&gt;cross-origin isolation&lt;/a&gt;&amp;quot;. With cross-origin isolation, you can
use powerful features such as &lt;code&gt;SharedArrayBuffer&lt;/code&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#coep&quot;&gt;Cross-Origin Embedder Policy (COEP)&lt;/a&gt; along with &lt;a href=&quot;https://web.dev/security-headers/#coop&quot;&gt;COOP&lt;/a&gt; to
enable cross-origin isolation.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;encrypt-traffic-to-your-site&quot;&gt;Encrypt traffic to your site &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#encrypt-traffic-to-your-site&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Encryption issues appear when an application does not fully encrypt data in
transit, allowing eavesdropping attackers to learn about the user&#39;s interactions
with the application.&lt;/p&gt;
&lt;p&gt;Insufficient encryption can arise in the following cases: not using HTTPS,
&lt;a href=&quot;https://web.dev/what-is-mixed-content/&quot;&gt;mixed content&lt;/a&gt;, setting cookies without the &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Cookies#restrict_access_to_cookies&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;Secure&lt;/code&gt;
attribute&lt;/a&gt;
(or &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Cookies#Cookie_prefixes&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;__Secure&lt;/code&gt;
prefix&lt;/a&gt;),
or &lt;a href=&quot;https://blog.detectify.com/2018/04/26/cors-misconfigurations-explained/&quot; rel=&quot;noopener&quot;&gt;lax CORS validation
logic&lt;/a&gt;.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;a href=&quot;https://web.dev/security-headers/#hsts&quot;&gt;HTTP Strict Transport Security (HSTS)&lt;/a&gt; to consisitently serve your
contents through HTTPS.&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;csp&quot;&gt;Content Security Policy (CSP) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#csp&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://www.google.com/about/appsecurity/learning/xss/&quot; rel=&quot;noopener&quot;&gt;Cross-Site Scripting
(XSS)&lt;/a&gt; is an attack
where a vulnerability on a website allows a malicious script to be injected and
executed.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Content-Security-Policy&lt;/code&gt; provides an added layer to mitigate XSS attacks by
restricting which scripts can be executed by the page.&lt;/p&gt;
&lt;p&gt;It&#39;s recommended that you enable strict CSP using one of the following approaches:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;If you render your HTML pages on the server, use &lt;strong&gt;a nonce-based strict CSP&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If your HTML has to be served statically or cached, for example if it&#39;s a
single-page application, use &lt;strong&gt;a hash-based strict CSP&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;label&quot;&gt;Example usage: A nonce-based CSP&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;Content-Security-Policy:&lt;br /&gt;  script-src &#39;nonce-{RANDOM1}&#39; &#39;strict-dynamic&#39; https: &#39;unsafe-inline&#39;;&lt;br /&gt;  object-src &#39;none&#39;;&lt;br /&gt;  base-uri &#39;none&#39;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use CSP
&lt;/summary&gt;
&lt;h3 id=&quot;recommended-usages&quot;&gt;Recommended usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#recommended-usages&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt;  A CSP can be an &lt;em&gt;extra&lt;/em&gt; protection against XSS attacks; you should still make sure to escape (and sanitize) user input.  &lt;/div&gt;&lt;/aside&gt;
&lt;h4 id=&quot;nonce-based-csp&quot;&gt;1. Use a nonce-based strict CSP &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#nonce-based-csp&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;If you render your HTML pages on the server, use &lt;strong&gt;a nonce-based strict CSP&lt;/strong&gt;.&lt;/p&gt;
&lt;aside class=&quot;aside flow bg-state-bad-bg color-state-bad-text&quot;&gt;&lt;p class=&quot;cluster color-state-bad-text&quot;&gt;&lt;span class=&quot;aside__icon box-block &quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; fill=&quot;currentColor&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; role=&quot;img&quot; aria-label=&quot;Error sign&quot;&gt;   &lt;path fill-rule=&quot;evenodd&quot; clip-rule=&quot;evenodd&quot; d=&quot;M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 15v-2h2v2h-2zm0-10v6h2V7h-2z&quot;&gt;&lt;/path&gt; &lt;/svg&gt;&lt;/span&gt;&lt;strong&gt;Caution&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot; flow&quot;&gt;  A nonce is a random number used only once. A nonce-based CSP is only secure if you can generate a different nonce for each response. If you can&#39;t do this, use &lt;a href=&quot;https://web.dev/security-headers/#hash-based-csp&quot;&gt;a hash-based CSP&lt;/a&gt; instead.  &lt;/div&gt;&lt;/aside&gt;
&lt;p&gt;Generate a new script nonce value for every request on the server side and set
the following header:&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;server configuration file&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;Content-Security-Policy:&lt;br /&gt;  script-src &#39;nonce-{RANDOM1}&#39; &#39;strict-dynamic&#39; https: &#39;unsafe-inline&#39;;&lt;br /&gt;  object-src &#39;none&#39;;&lt;br /&gt;  base-uri &#39;none&#39;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;In HTML, in order to load the scripts, set the &lt;code&gt;nonce&lt;/code&gt; attribute of all
&lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; tags to the same &lt;code&gt;{RANDOM1}&lt;/code&gt; string.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;index.html&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;nonce&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;{RANDOM1}&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;https://example.com/script1.js&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;nonce&lt;/span&gt;&lt;span class=&quot;token attr-value&quot;&gt;&lt;span class=&quot;token punctuation attr-equals&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;{RANDOM1}&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;&lt;br /&gt;  &lt;span class=&quot;token comment&quot;&gt;// Inline scripts can be used with the `nonce` attribute.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;https://photos.google.com/&quot; rel=&quot;noopener&quot;&gt;Google Photos&lt;/a&gt; is a good nonce-based strict CSP
example. Use DevTools to see how it&#39;s used.&lt;/p&gt;
&lt;h4 id=&quot;hash-based-csp&quot;&gt;2. Use a hash-based strict CSP &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#hash-based-csp&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;If your HTML has to be served statically or cached, for example if you&#39;re
building a single-page application, use &lt;strong&gt;a hash-based strict CSP&lt;/strong&gt;.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;server configuration file&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;Content-Security-Policy:&lt;br /&gt;  script-src &#39;sha256-{HASH1}&#39; &#39;sha256-{HASH2}&#39; &#39;strict-dynamic&#39; https: &#39;unsafe-inline&#39;;&lt;br /&gt;  object-src &#39;none&#39;;&lt;br /&gt;  base-uri &#39;none&#39;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;In HTML, you&#39;ll need to inline your scripts in order to apply a hash-based
policy, because &lt;a href=&quot;https://wpt.fyi/results/content-security-policy/script-src/script-src-sri_hash.sub.html?label=master&amp;amp;label=experimental&amp;amp;aligned&quot; rel=&quot;noopener&quot;&gt;most browsers don&#39;t support hashing external
scripts&lt;/a&gt;.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;index.html&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-html&quot;&gt;&lt;code class=&quot;language-html&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;&lt;br /&gt;&lt;span class=&quot;token operator&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;token comment&quot;&gt;// your script1, inlined&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token script&quot;&gt;&lt;span class=&quot;token language-javascript&quot;&gt;&lt;br /&gt;&lt;span class=&quot;token operator&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;token comment&quot;&gt;// your script2, inlined&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token tag&quot;&gt;&lt;span class=&quot;token punctuation&quot;&gt;&amp;lt;/&lt;/span&gt;script&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;To load external scripts, read &amp;quot;Load sourced scripts dynamically&amp;quot; under
&lt;a href=&quot;https://web.dev/strict-csp/#hash-based-csp&quot;&gt;Option B: Hash-based CSP Response Header&lt;/a&gt; section.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://csp-evaluator.withgoogle.com/&quot; rel=&quot;noopener&quot;&gt;CSP Evaluator&lt;/a&gt; is a good tool to
evaluate your CSP, but at the same time a good nonce-based strict CSP example.
Use DevTools to see how it&#39;s used.&lt;/p&gt;
&lt;h3 id=&quot;supported-browsers&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome, Not supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;no&quot; title=&quot;Not supported&quot; aria-label=&quot;Not supported&quot;&gt;
&lt;p&gt;&lt;/p&gt;&lt;/span&gt;
&lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
&lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
&lt;span class=&quot;visually-hidden&quot;&gt;Firefox, Not supported&lt;/span&gt;
&lt;/span&gt;
&lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;no&quot; title=&quot;Not supported&quot; aria-label=&quot;Not supported&quot;&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/span&gt;
&lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
&lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
&lt;span class=&quot;visually-hidden&quot;&gt;Edge, Not supported&lt;/span&gt;
&lt;/span&gt;
&lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;no&quot; title=&quot;Not supported&quot; aria-label=&quot;Not supported&quot;&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/span&gt;
&lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
&lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
&lt;span class=&quot;visually-hidden&quot;&gt;Safari, Not supported&lt;/span&gt;
&lt;/span&gt;
&lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;no&quot; title=&quot;Not supported&quot; aria-label=&quot;Not supported&quot;&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/span&gt;
&lt;/li&gt;&lt;p&gt;&lt;/p&gt;
  &lt;/ul&gt;
&lt;/div&gt;
&lt;aside class=&quot;aside flow bg-tertiary-box-bg color-tertiary-box-text&quot;&gt;&lt;p class=&quot;cluster &quot;&gt;&lt;span class=&quot;aside__icon box-block &quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; role=&quot;img&quot; aria-label=&quot;Lightbulb&quot; fill=&quot;currentColor&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;   &lt;path d=&quot;M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6A4.997 4.997 0 017 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z&quot;&gt;&lt;/path&gt; &lt;/svg&gt;&lt;/span&gt;&lt;strong&gt;Gotchas&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot; flow&quot;&gt;  * &lt;code&gt;https:&lt;/code&gt; is a fallback for Safari and &lt;code&gt;unsafe-inline&lt;/code&gt; is a fallback for very old browser versions. &lt;code&gt;https:&lt;/code&gt; and &lt;code&gt;unsafe-inline&lt;/code&gt; don&#39;t make your policy less safe because they will be ignored by browsers who support &lt;code&gt;strict-dynamic&lt;/code&gt;. Read more in &lt;a href=&quot;https://web.dev/strict-csp/#step-4-add-fallbacks-to-support-safari-and-older-browsers&quot;&gt;Add fallbacks to support Safari and older browsers&lt;/a&gt;. * Safari does &lt;em&gt;not&lt;/em&gt; support &lt;code&gt;strict-dynamic&lt;/code&gt; yet. But a strict CSP like in the examples above is safer than an allowlist CSP (and much safer than no CSP at all) for all of your users. Even in Safari, a strict CSP protects your site from some types of XSS attacks, because the presence of the CSP disallows certain unsafe patterns.  &lt;/div&gt;&lt;/aside&gt;
&lt;h3 id=&quot;other-things-to-note-about-csp&quot;&gt;Other things to note about CSP &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#other-things-to-note-about-csp&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;frame-ancestors&lt;/code&gt;&lt;/a&gt;
directive protects your site from clickjacking—a risk that arises if you allow
untrusted sites to embed yours. If you prefer simpler solution, you can use
&lt;a href=&quot;https://web.dev/security-headers/#xfo&quot;&gt;&lt;code&gt;X-Frame-Options&lt;/code&gt;&lt;/a&gt; to block being loaded, but &lt;code&gt;frame-ancestors&lt;/code&gt; gives
you an advanced configuration to only allow specific origins as embedders.&lt;/li&gt;
&lt;li&gt;You may have used &lt;a href=&quot;https://web.dev/fixing-mixed-content/#content-security-policy&quot;&gt;a CSP to ensure that all of your site&#39;s resources are
loaded over HTTPS&lt;/a&gt;. This has
become less relevant: nowadays, most browsers block
&lt;a href=&quot;https://web.dev/what-is-mixed-content/&quot;&gt;mixed-content&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;You can also set a CSP in &lt;a href=&quot;https://web.dev/strict-csp/#step-2-set-a-strict-csp-and-prepare-your-scripts&quot;&gt;report-only
mode&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you can&#39;t set a CSP as a header server-side, you can also set it as a meta
tag. Note that you can&#39;t use &lt;strong&gt;report-only&lt;/strong&gt; mode for meta tags (though
&lt;a href=&quot;https://github.com/w3c/webappsec-csp/issues/277&quot; rel=&quot;noopener&quot;&gt;this may change&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;learn-more&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/strict-csp&quot;&gt;Mitigate XSS with a Strict Content Security Policy (CSP)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html&quot; rel=&quot;noopener&quot;&gt;Content Security Policy Cheat
Sheet&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;tt&quot;&gt;Trusted Types &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#tt&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://portswigger.net/web-security/cross-site-scripting/dom-based&quot; rel=&quot;noopener&quot;&gt;DOM-based
XSS&lt;/a&gt; is an
attack where a malicious data is passed into a sink that supports dynamic code
execution such as &lt;code&gt;eval()&lt;/code&gt; or &lt;code&gt;.innerHTML&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Trusted Types provide the tools to write, security review, and maintain
applications free of DOM XSS. They can be enabled via &lt;a href=&quot;https://web.dev/security-headers/#csp&quot;&gt;CSP&lt;/a&gt; and make
JavaScript code secure by default by limiting dangerous web APIs to only accept
a special object—a Trusted Type.&lt;/p&gt;
&lt;p&gt;To create these objects you can define security policies in which you can ensure
that security rules (such as escaping or sanitization) are consistently applied
before the data is written to the DOM. These policies are then the only places
in code that could potentially introduce DOM XSS.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example usages&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Content-Security-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value csp languages-csp&quot;&gt;require-trusted-types-for &#39;script&#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Feature detection&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;trustedTypes &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; trustedTypes&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;createPolicy&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token comment&quot;&gt;// Name and create a policy&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; policy &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; trustedTypes&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createPolicy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;escapePolicy&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token function-variable function&quot;&gt;createHTML&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token parameter&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; str&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token regex&quot;&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-source language-regex&quot;&gt;&lt;span class=&quot;token escape&quot;&gt;\&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-flags&quot;&gt;g&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;&amp;amp;lt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token regex&quot;&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-source language-regex&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-flags&quot;&gt;g&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;&amp;amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Assignment of raw strings is blocked by Trusted Types.&lt;/span&gt;&lt;br /&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;some string&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// This throws an exception.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token comment&quot;&gt;// Assignment of Trusted Types is accepted safely.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; escaped &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; policy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createHTML&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;&amp;lt;img src=x onerror=alert(1)&gt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; escaped&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;token comment&quot;&gt;// &#39;&amp;amp;lt;img src=x onerror=alert(1)&amp;amp;gt;&#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use Trusted Types
&lt;/summary&gt;
&lt;h3 id=&quot;recommended-usages-2&quot;&gt;Recommended usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#recommended-usages-2&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Enforce Trusted Types for dangerous DOM sinks&lt;/p&gt;
 &lt;p class=&quot;label&quot;&gt;CSP and Trusted Types header:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Content-Security-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value csp languages-csp&quot;&gt;require-trusted-types-for &#39;script&#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Currently &lt;code&gt;&#39;script&#39;&lt;/code&gt; is the only acceptable value for
&lt;code&gt;require-trusted-types-for&lt;/code&gt; directive.&lt;/p&gt;
&lt;p&gt;Of course, you can combine Trusted Types with other CSP directives:&lt;/p&gt;
 &lt;p class=&quot;label&quot;&gt; Merging a nonce-based CSP from above with Trusted Types: &lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;Content-Security-Policy:&lt;br /&gt;  script-src &#39;nonce-{RANDOM1}&#39; &#39;strict-dynamic&#39; https: &#39;unsafe-inline&#39;;&lt;br /&gt;  object-src &#39;none&#39;;&lt;br /&gt;  base-uri &#39;none&#39;;&lt;br /&gt;  require-trusted-types-for &#39;script&#39;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt; &lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt;  You may limit allowed Trusted Types policy names by setting an additional &lt;code&gt;trusted-types&lt;/code&gt; directive (for example, &lt;code&gt;trusted-types myPolicy&lt;/code&gt;). However, this is not a requirement.  &lt;/div&gt;&lt;/aside&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Define a policy&lt;/p&gt;
 &lt;p class=&quot;label&quot;&gt;Policy:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Feature detection&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;trustedTypes &lt;span class=&quot;token operator&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; trustedTypes&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;createPolicy&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token comment&quot;&gt;// Name and create a policy&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; policy &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; trustedTypes&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createPolicy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;escapePolicy&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token function-variable function&quot;&gt;createHTML&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token parameter&quot;&gt;str&lt;/span&gt; &lt;span class=&quot;token operator&quot;&gt;=&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;      &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; str&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token regex&quot;&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-source language-regex&quot;&gt;&lt;span class=&quot;token escape&quot;&gt;\&amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-flags&quot;&gt;g&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;&amp;amp;lt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;replace&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token regex&quot;&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-source language-regex&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;token regex-delimiter&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;token regex-flags&quot;&gt;g&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;&amp;amp;gt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;  &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt; &lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt;  You can define policies with arbitrary names unless you limit the names of allowed Trusted Types policies by setting the &lt;code&gt;trusted-types&lt;/code&gt; directive.  &lt;/div&gt;&lt;/aside&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Apply the policy&lt;/p&gt;
 &lt;p class=&quot;label&quot;&gt;Use the policy when writing data to the DOM:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token comment&quot;&gt;// Assignment of raw strings are blocked by Trusted Types.&lt;/span&gt;&lt;br /&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;some string&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token comment&quot;&gt;// This throws an exception.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token comment&quot;&gt;// Assignment of Trusted Types is accepted safely.&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token keyword&quot;&gt;const&lt;/span&gt; escaped &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; policy&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;createHTML&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;&amp;lt;img src=x onerror=alert(1)&gt;&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;el&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;innerHTML &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; escaped&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;  &lt;span class=&quot;token comment&quot;&gt;// &#39;&amp;amp;lt;img src=x onerror=alert(1)&amp;amp;gt;&#39;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;With &lt;code&gt;require-trusted-types-for &#39;script&#39;&lt;/code&gt;, using a trusted type is a
requirement. Using any dangerous DOM API with a string will result in an
error.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;supported-browsers-2&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers-2&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome, Not supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;no&quot; title=&quot;Not supported&quot; aria-label=&quot;Not supported&quot;&gt;
&lt;p&gt;&lt;/p&gt;&lt;/span&gt;
&lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
&lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
&lt;span class=&quot;visually-hidden&quot;&gt;Firefox, Not supported&lt;/span&gt;
&lt;/span&gt;
&lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;no&quot; title=&quot;Not supported&quot; aria-label=&quot;Not supported&quot;&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/span&gt;
&lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
&lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
&lt;span class=&quot;visually-hidden&quot;&gt;Edge, Not supported&lt;/span&gt;
&lt;/span&gt;
&lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;no&quot; title=&quot;Not supported&quot; aria-label=&quot;Not supported&quot;&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/span&gt;
&lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
&lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
&lt;span class=&quot;visually-hidden&quot;&gt;Safari, Not supported&lt;/span&gt;
&lt;/span&gt;
&lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;no&quot; title=&quot;Not supported&quot; aria-label=&quot;Not supported&quot;&gt;&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;/span&gt;
&lt;/li&gt;&lt;p&gt;&lt;/p&gt;
  &lt;/ul&gt;
&lt;/div&gt;
&lt;h3 id=&quot;learn-more-2&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more-2&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/trusted-types/&quot;&gt;Prevent DOM-based cross-site scripting vulnerabilities with Trusted
Types&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/require-trusted-types-for&quot; rel=&quot;noopener&quot;&gt;CSP: require-trusted-types-for - HTTP |
MDN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types&quot; rel=&quot;noopener&quot;&gt;CSP: trusted-types - HTTP |
MDN&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.compass-demo.com/trusted-types/&quot; rel=&quot;noopener&quot;&gt;Trusted Types demo&lt;/a&gt;—open DevTools Inspector and see
what is happening&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;xcto&quot;&gt;X-Content-Type-Options &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#xcto&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When a malicious HTML document is served from your domain (for example, if an
image uploaded to a photo service contains valid HTML markup), some browsers
will treat it as an active document and allow it to execute scripts in the
context of the application, leading to a &lt;a href=&quot;https://www.google.com/about/appsecurity/learning/xss/&quot; rel=&quot;noopener&quot;&gt;cross-site scripting
bug&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;X-Content-Type-Options: nosniff&lt;/code&gt; prevents it by instructing the browser that
the &lt;a href=&quot;https://mimesniff.spec.whatwg.org/#introduction&quot; rel=&quot;noopener&quot;&gt;MIME type&lt;/a&gt; set in the
&lt;code&gt;Content-Type&lt;/code&gt; header for a given response is correct. This header is
recommended for &lt;strong&gt;all of your resources&lt;/strong&gt;.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example usage&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;X-Content-Type-Options&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;nosniff&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use X-Content-Type-Options
&lt;/summary&gt;
&lt;h3 id=&quot;recommended-usages-3&quot;&gt;Recommended usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#recommended-usages-3&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;X-Content-Type-Options: nosniff&lt;/code&gt; is recommended for all resources served from
your server along with the correct &lt;code&gt;Content-Type&lt;/code&gt; header.&lt;/p&gt;
&lt;img alt=&quot;X-Content-Type-Options: nosniff&quot; decoding=&quot;async&quot; height=&quot;237&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/IWqRWe9R1mOJImmMbLoM.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;p class=&quot;label&quot;&gt;Example headers sent with a document HTML&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;X-Content-Type-Options&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;nosniff&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Content-Type&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;text/html; charset=utf-8&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h3 id=&quot;supported-browsers-3&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers-3&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome 64, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      64
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Firefox 50, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      50
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Edge 12, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      12
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Safari 11, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      11
    &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;a class=&quot;wdi-browser-compat__link&quot; href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Content-Type-Options#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;h3 id=&quot;learn-more-3&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more-3&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Content-Type-Options&quot; rel=&quot;noopener&quot;&gt;X-Content-Type-Options - HTTP MDN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;xfo&quot;&gt;X-Frame-Options &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#xfo&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;If a malicious website can embed your site as an iframe, this may allow
attackers to invoke unintended actions by the user with
&lt;a href=&quot;https://portswigger.net/web-security/clickjacking&quot; rel=&quot;noopener&quot;&gt;clickjacking&lt;/a&gt;. Also, in some
cases &lt;a href=&quot;https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)&quot; rel=&quot;noopener&quot;&gt;Spectre-type
attacks&lt;/a&gt; give
malicious websites a chance to learn about the contents of an embedded document.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;X-Frame-Options&lt;/code&gt; indicates whether or not a browser should be allowed to render
a page in a &lt;code&gt;&amp;lt;frame&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;lt;embed&amp;gt;&lt;/code&gt;, or &lt;code&gt;&amp;lt;object&amp;gt;&lt;/code&gt;. &lt;strong&gt;All documents&lt;/strong&gt;
are recommended to send this header to indicate whether they allow being
embedded by other documents.&lt;/p&gt;
&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt;  If you need more granular control such as allowing only a specific origin to embed the document, use the &lt;a href=&quot;https://web.dev/security-headers/#csp&quot;&gt;CSP&lt;/a&gt; &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/frame-ancestors&quot;&gt;&lt;code&gt;frame-ancestors&lt;/code&gt;&lt;/a&gt; directive.  &lt;/div&gt;&lt;/aside&gt;
&lt;p class=&quot;label&quot;&gt;Example usage&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;X-Frame-Options&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;DENY&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use X-Frame-Options
&lt;/summary&gt;
&lt;h3 id=&quot;recommended-usages-4&quot;&gt;Recommended usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#recommended-usages-4&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;All documents that are not designed to be embedded should use &lt;code&gt;X-Frame-Options&lt;/code&gt; header.&lt;/p&gt;
&lt;p&gt;You can try how the following configurations affect loading an iframe on &lt;a href=&quot;https://cross-origin-isolation.glitch.me/&quot; rel=&quot;noopener&quot;&gt;this
demo&lt;/a&gt;. Change the &lt;code&gt;X-Frame-Options&lt;/code&gt;
dropdown menu and click the &lt;strong&gt;Reload the iframe&lt;/strong&gt; button.&lt;/p&gt;
&lt;h4 id=&quot;protects-your-website-from-being-embedded-by-any-other-websites&quot;&gt;Protects your website from being embedded by any other websites &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#protects-your-website-from-being-embedded-by-any-other-websites&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Deny being embedded by any other documents.&lt;/p&gt;
&lt;img alt=&quot;X-Frame-Options: DENY&quot; decoding=&quot;async&quot; height=&quot;237&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2ZM5obgGK38CMcZ75PkH.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;X-Frame-Options&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;DENY&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h4 id=&quot;protects-your-website-from-being-embedded-by-any-cross-origin-websites&quot;&gt;Protects your website from being embedded by any cross-origin websites &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#protects-your-website-from-being-embedded-by-any-cross-origin-websites&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Allow being embedded only by same-origin documents.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;X-Frame-Options&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;SAMEORIGIN&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;aside class=&quot;aside flow bg-tertiary-box-bg color-tertiary-box-text&quot;&gt;&lt;p class=&quot;cluster &quot;&gt;&lt;span class=&quot;aside__icon box-block &quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; role=&quot;img&quot; aria-label=&quot;Lightbulb&quot; fill=&quot;currentColor&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;   &lt;path d=&quot;M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6A4.997 4.997 0 017 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z&quot;&gt;&lt;/path&gt; &lt;/svg&gt;&lt;/span&gt;&lt;strong&gt;Gotchas&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot; flow&quot;&gt;  Documents being embeddable by default means the web developers need to explicitly send &lt;code&gt;DENY&lt;/code&gt; or &lt;code&gt;SAMEORIGIN&lt;/code&gt; to stop being embedded and protect themselves from side-channel attacks. The Chrome team is considering switching to block document embeds by default so that websites will be secure even if they don&#39;t explicitly set the header. In that new world, documents would need to explicitly opt-in to be embedded.  &lt;/div&gt;&lt;/aside&gt;
&lt;h3 id=&quot;supported-browsers-4&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers-4&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome 4, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      4
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Firefox 4, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      4
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Edge 12, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      12
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Safari 4, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      4
    &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;a class=&quot;wdi-browser-compat__link&quot; href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Frame-Options#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;h3 id=&quot;learn-more-4&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more-4&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Frame-Options&quot; rel=&quot;noopener&quot;&gt;X-Frame-Options - HTTP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;corp&quot;&gt;Cross-Origin Resource Policy (CORP) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#corp&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An attacker can embed resources from another origin, for example from your site,
to learn information about them by exploiting web-based &lt;a href=&quot;https://xsleaks.dev/&quot; rel=&quot;noopener&quot;&gt;cross-site
leaks&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Cross-Origin-Resource-Policy&lt;/code&gt; mitigates this risk by indicating the set of
websites it can be loaded by. The header takes one of three values:
&lt;code&gt;same-origin&lt;/code&gt;, &lt;code&gt;same-site&lt;/code&gt;, and &lt;code&gt;cross-origin&lt;/code&gt;. &lt;strong&gt;All resources&lt;/strong&gt; are
recommended to send this header to indicate whether they allow being loaded by
other websites.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example usage&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Resource-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-origin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use CORP
&lt;/summary&gt;
&lt;h3 id=&quot;recommended-usages-5&quot;&gt;Recommended usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#recommended-usages-5&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It is recommended that &lt;strong&gt;all&lt;/strong&gt; resources are served with one of the following
three headers.&lt;/p&gt;
&lt;p&gt;You can try how the following configurations affect loading resources under a
&lt;a href=&quot;https://web.dev/security-headers/#coep&quot;&gt;&lt;code&gt;Cross-Origin-Embedder-Policy: require-corp&lt;/code&gt; environment&lt;/a&gt; on &lt;a href=&quot;https://cross-origin-isolation.glitch.me/?coep=require-corp&amp;amp;&quot; rel=&quot;noopener&quot;&gt;this
demo&lt;/a&gt;. Change the
&lt;strong&gt;Cross-Origin-Resource-Policy&lt;/strong&gt; dropdown menu and click the &lt;strong&gt;Reload the
iframe&lt;/strong&gt; or &lt;strong&gt;Reload the image&lt;/strong&gt; button to see the effect.&lt;/p&gt;
&lt;h4 id=&quot;allow-resources-to-be-loaded-cross-origin&quot;&gt;Allow resources to be loaded &lt;code&gt;cross-origin&lt;/code&gt; &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#allow-resources-to-be-loaded-cross-origin&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;It&#39;s recommended that CDN-like services apply &lt;code&gt;cross-origin&lt;/code&gt; to resources
(since they are usually loaded by cross-origin pages), unless they are already served
through &lt;a href=&quot;https://web.dev/security-headers/#cors&quot;&gt;CORS&lt;/a&gt; which has a similar effect.&lt;/p&gt;
&lt;img alt=&quot;Cross-Origin-Resource-Policy: cross-origin&quot; decoding=&quot;async&quot; height=&quot;234&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/qP2mspVMC6RazxDjWUrL.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Resource-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;cross-origin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h4 id=&quot;limit-resources-to-be-loaded-from-the-same-origin&quot;&gt;Limit resources to be loaded from the &lt;code&gt;same-origin&lt;/code&gt; &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#limit-resources-to-be-loaded-from-the-same-origin&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;same-origin&lt;/code&gt; should be applied to resources that are intended to be loaded only
by same-origin pages. You should apply this to resources that include sensitive
information about the user, or responses of an API that is intended to be called
only from the same origin.&lt;/p&gt;
&lt;p&gt;Keep in mind that resources with this header can still be loaded directly, for
example by navigating to the URL in a new browser window. Cross-Origin Resource
Policy only protects the resource from being embedded by other websites.&lt;/p&gt;
&lt;img alt=&quot;Cross-Origin-Resource-Policy: same-origin&quot; decoding=&quot;async&quot; height=&quot;238&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/7UzYMWsbKkh89m5ZImvj.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Resource-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-origin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h4 id=&quot;limit-resources-to-be-loaded-from-the-same-site&quot;&gt;Limit resources to be loaded from the &lt;code&gt;same-site&lt;/code&gt; &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#limit-resources-to-be-loaded-from-the-same-site&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;same-site&lt;/code&gt; is recommended to be applied to resources that are similar to above
but are intended to be loaded by other subdomains of your site.&lt;/p&gt;
&lt;img alt=&quot;Cross-Origin-Resource-Policy: same-site&quot; decoding=&quot;async&quot; height=&quot;233&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/R9yNRGSJ4xABc560WRJI.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Resource-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-site&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt;  To learn more about the difference between same-origin and same-site, check out &lt;a href=&quot;https://web.dev/same-site-same-origin/&quot;&gt;Understanding &amp;quot;same-site&amp;quot; and &amp;quot;same-origin&amp;quot;&lt;/a&gt;.  &lt;/div&gt;&lt;/aside&gt;
&lt;h3 id=&quot;supported-browsers-5&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers-5&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome 73, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      73
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Firefox 74, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      74
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Edge 79, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      79
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Safari 12, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      12
    &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;a class=&quot;wdi-browser-compat__link&quot; href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;h3 id=&quot;learn-more-5&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more-5&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://resourcepolicy.fyi/&quot; rel=&quot;noopener&quot;&gt;Consider deploying cross-origin resource policy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/coop-coep/&quot;&gt;Making your website &amp;quot;cross-origin isolated&amp;quot; using COOP and COEP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/why-coop-coep/&quot;&gt;Why you need &amp;quot;cross-origin isolated&amp;quot; for powerful features&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;coop&quot;&gt;Cross-Origin Opener Policy (COOP) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#coop&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;An attacker&#39;s website can open another site in a popup window to learn
information about it by exploiting web-based &lt;a href=&quot;https://xsleaks.dev/&quot; rel=&quot;noopener&quot;&gt;cross-site
leaks&lt;/a&gt;. In some cases, this may also allow the
exploitation of side-channel attacks based on
&lt;a href=&quot;https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)&quot; rel=&quot;noopener&quot;&gt;Spectre&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;Cross-Origin-Opener-Policy&lt;/code&gt; header provides a way for a document to isolate
itself from cross-origin windows opened through &lt;code&gt;window.open()&lt;/code&gt; or a link with
&lt;code&gt;target=&amp;quot;_blank&amp;quot;&lt;/code&gt; without &lt;code&gt;rel=&amp;quot;noopener&amp;quot;&lt;/code&gt;. As a result, any cross-origin opener
of the document will have no reference to it and will not be able to interact
with it.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example usage&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Opener-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-origin-allow-popups&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use COOP
&lt;/summary&gt;
&lt;h3 id=&quot;recommended-usages-6&quot;&gt;Recommended usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#recommended-usages-6&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can try how the following configurations affect communication with a
cross-origin popup window on &lt;a href=&quot;https://cross-origin-isolation.glitch.me/&quot; rel=&quot;noopener&quot;&gt;this demo&lt;/a&gt;.
Change the &lt;strong&gt;Cross-Origin-Opener-Policy&lt;/strong&gt; dropdown menu for both the document
and the popup window, click the &lt;strong&gt;Open a popup&lt;/strong&gt; button then click &lt;strong&gt;Send a
postMessage&lt;/strong&gt; to see if the message is actually delivered.&lt;/p&gt;
&lt;h4 id=&quot;isolate-a-document-from-cross-origin-windows&quot;&gt;Isolate a document from cross-origin windows &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#isolate-a-document-from-cross-origin-windows&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Setting &lt;code&gt;same-origin&lt;/code&gt; puts the document to be isolated from cross-origin
document windows.&lt;/p&gt;
&lt;img alt=&quot;Cross-Origin-Opener-Policy: same-origin&quot; decoding=&quot;async&quot; height=&quot;235&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/mSDG9auD7r5asxGJvJjg.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Opener-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-origin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h4 id=&quot;isolate-a-document-from-cross-origin-windows-but-allow-popups&quot;&gt;Isolate a document from cross-origin windows but allow popups &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#isolate-a-document-from-cross-origin-windows-but-allow-popups&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Setting &lt;code&gt;same-origin-allow-popups&lt;/code&gt; allows a document to retain a reference to
its popup windows unless they set COOP with &lt;code&gt;same-origin&lt;/code&gt; or
&lt;code&gt;same-origin-allow-popups&lt;/code&gt;. This means &lt;code&gt;same-origin-allow-popups&lt;/code&gt; can still
protect the document from being referenced when opened as a popup window, but
allow it to communicate with its own popups.&lt;/p&gt;
&lt;img alt=&quot;Cross-Origin-Opener-Policy: same-origin-allow-popups&quot; decoding=&quot;async&quot; height=&quot;233&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/2uJZ0s2VnjxJUcBI2Ol9.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Opener-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-origin-allow-popups&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h4 id=&quot;allow-a-document-to-be-referenced-by-cross-origin-windows&quot;&gt;Allow a document to be referenced by cross-origin windows &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#allow-a-document-to-be-referenced-by-cross-origin-windows&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;unsafe-none&lt;/code&gt; is the default value but you can explicitly indicate that this
document can be opened by a cross-origin window and retain mutual access.&lt;/p&gt;
&lt;img alt=&quot;Cross-Origin-Opener-Policy: unsafe-none&quot; decoding=&quot;async&quot; height=&quot;233&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/YLflGBAPWecgtKJLqCJHSzHqe2J2/oSco89ZT3RP7gZzNKDjY.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;aside class=&quot;aside flow bg-tertiary-box-bg color-tertiary-box-text&quot;&gt;&lt;p class=&quot;cluster &quot;&gt;&lt;span class=&quot;aside__icon box-block &quot;&gt;&lt;svg width=&quot;24&quot; height=&quot;24&quot; viewBox=&quot;0 0 24 24&quot; role=&quot;img&quot; aria-label=&quot;Lightbulb&quot; fill=&quot;currentColor&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;   &lt;path d=&quot;M9 21c0 .55.45 1 1 1h4c.55 0 1-.45 1-1v-1H9v1zm3-19C8.14 2 5 5.14 5 9c0 2.38 1.19 4.47 3 5.74V17c0 .55.45 1 1 1h6c.55 0 1-.45 1-1v-2.26c1.81-1.27 3-3.36 3-5.74 0-3.86-3.14-7-7-7zm2.85 11.1l-.85.6V16h-4v-2.3l-.85-.6A4.997 4.997 0 017 9c0-2.76 2.24-5 5-5s5 2.24 5 5c0 1.63-.8 3.16-2.15 4.1z&quot;&gt;&lt;/path&gt; &lt;/svg&gt;&lt;/span&gt;&lt;strong&gt;Gotchas&lt;/strong&gt;&lt;/p&gt;&lt;div class=&quot; flow&quot;&gt;  &lt;code&gt;unsafe-none&lt;/code&gt; being the default means the web developers need to send &lt;code&gt;same-origin&lt;/code&gt; or &lt;code&gt;same-origin-allow-popups&lt;/code&gt; explicitly to protect their website from side-channel attacks.  &lt;/div&gt;&lt;/aside&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Opener-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;unsafe-none&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt;  Features such as &lt;code&gt;SharedArrayBuffer&lt;/code&gt; or &lt;code&gt;performance.measureUserAgentSpecificMemory()&lt;/code&gt; are disabled by default. Some browsers allow you to use them in &amp;quot;cross-origin isolated&amp;quot; contexts, which require you to set &lt;a href=&quot;https://web.dev/security-headers/#coop&quot;&gt;COOP&lt;/a&gt; and &lt;a href=&quot;https://web.dev/security-headers/#coep&quot;&gt;COEP&lt;/a&gt; headers.  To learn more, read &lt;a href=&quot;https://web.dev/coop-coep/&quot;&gt;Making your website &amp;quot;cross-origin isolated&amp;quot; using COOP and COEP&lt;/a&gt;.  &lt;/div&gt;&lt;/aside&gt;
&lt;h4 id=&quot;report-patterns-incompatible-with-coop&quot;&gt;Report patterns incompatible with COOP &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#report-patterns-incompatible-with-coop&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;You can receive reports when COOP prevents cross-window interactions with the
Reporting API.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Opener-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-origin; report-to=&quot;coop&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;COOP also supports a report-only mode so you can receive reports without
actually blocking communication between cross-origin documents.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Opener-Policy-Report-Only&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-origin; report-to=&quot;coop&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h3 id=&quot;supported-browsers-6&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers-6&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome 83, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      83
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Firefox 79, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      79
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Edge 83, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      83
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Safari 15.2, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      15.2
    &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;a class=&quot;wdi-browser-compat__link&quot; href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;h3 id=&quot;learn-more-6&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more-6&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/why-coop-coep/&quot;&gt;Why you need &amp;quot;cross-origin isolated&amp;quot; for powerful features&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;cors&quot;&gt;Cross-Origin Resource Sharing (CORS) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#cors&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Unlike other items in this article, Cross-Origin Resource Sharing (CORS) is not
a header, but a browser mechanism that requests and permits access to
cross-origin resources.&lt;/p&gt;
&lt;p&gt;By default, browsers enforce &lt;a href=&quot;https://web.dev/same-origin-policy/&quot;&gt;the same-origin policy&lt;/a&gt; to
prevent a web page from accessing cross-origin resources. For example, when a
cross-origin image is loaded, even though it&#39;s displayed on the web page
visually, the JavaScript on the page doesn&#39;t have access to the image&#39;s data.
The resource provider can relax restrictions and allow other websites to read
the resource by opting-in with CORS.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example usage&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Allow-Origin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;https://example.com&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Allow-Credentials&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use CORS
&lt;/summary&gt;
&lt;p&gt;Before looking into how to configure CORS, it&#39;s helpful to understand the
distinction between request types. Depending on request details, a request will
be classified as a &lt;strong&gt;simple request&lt;/strong&gt; or a &lt;strong&gt;preflighted request&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Criteria for a simple request:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The method is &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;HEAD&lt;/code&gt;, or &lt;code&gt;POST&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The custom headers only include &lt;code&gt;Accept&lt;/code&gt;, &lt;code&gt;Accept-Language&lt;/code&gt;,
&lt;code&gt;Content-Language&lt;/code&gt;, and &lt;code&gt;Content-Type&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Content-Type&lt;/code&gt; is &lt;code&gt;application/x-www-form-urlencoded&lt;/code&gt;,
&lt;code&gt;multipart/form-data&lt;/code&gt;, or &lt;code&gt;text/plain&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Everything else is classified as a preflighted request. For more details,
check out &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/CORS#simple_requests&quot; rel=&quot;noopener&quot;&gt;Cross-Origin Resource Sharing (CORS) - HTTP |
MDN&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;recommended-usages-7&quot;&gt;Recommended usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#recommended-usages-7&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;h4 id=&quot;simple-request&quot;&gt;Simple request &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#simple-request&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;When a request meets the simple request criteria, the browser sends a
cross-origin request with an &lt;code&gt;Origin&lt;/code&gt; header that indicates the requesting
origin.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example request header&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;Get / HTTP/1.1&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Origin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;https://example.com&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p class=&quot;label&quot;&gt;Example response header&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Allow-Origin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;https://example.com&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Allow-Credentials&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Access-Control-Allow-Origin: https://example.com&lt;/code&gt; indicates that the
&lt;code&gt;https://example.com&lt;/code&gt; can access the contents of the response. Resources meant
to be readable by any site can set this header to &lt;code&gt;*&lt;/code&gt;, in which case the
browser will only require the request to be made &lt;a href=&quot;https://developer.mozilla.org/docs/Web/API/Request/credentials#value&quot; rel=&quot;noopener&quot;&gt;without
credentials&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Access-Control-Allow-Credentials: true&lt;/code&gt; indicates that requests which carry
credentials (cookies) are allowed to load the resource. Otherwise,
authenticated requests will be rejected even if the requesting origin is
present in the &lt;code&gt;Access-Control-Allow-Origin&lt;/code&gt; header.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can try how the simple request affect loading resources under a
&lt;a href=&quot;https://web.dev/security-headers/#coep&quot;&gt;&lt;code&gt;Cross-Origin-Embedder-Policy: require-corp&lt;/code&gt; environment&lt;/a&gt; on &lt;a href=&quot;https://cross-origin-isolation.glitch.me/?coep=require-corp&amp;amp;&quot; rel=&quot;noopener&quot;&gt;this
demo&lt;/a&gt;. Click the
&lt;strong&gt;Cross-Origin Resource Sharing&lt;/strong&gt; checkbox and click the &lt;strong&gt;Reload the image&lt;/strong&gt;
button to see the effect.&lt;/p&gt;
&lt;h4 id=&quot;preflighted-requests&quot;&gt;Preflighted requests &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#preflighted-requests&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;A preflighted request is preceded with an &lt;code&gt;OPTIONS&lt;/code&gt; request to check if the
subsequent request is allowed to be sent.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example request header&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token request-line&quot;&gt;&lt;span class=&quot;token method property&quot;&gt;OPTIONS&lt;/span&gt; &lt;span class=&quot;token request-target url&quot;&gt;/&lt;/span&gt; &lt;span class=&quot;token http-version property&quot;&gt;HTTP/1.1&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Origin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;https://example.com&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Request-Method&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;POST&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Request-Headers&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;X-PINGOTHER, Content-Type&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Access-Control-Request-Method: POST&lt;/code&gt; allows the following request to be made
with the  &lt;code&gt;POST&lt;/code&gt; method.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Access-Control-Request-Headers: X-PINGOTHER, Content-Type&lt;/code&gt; allows the
requester to set the &lt;code&gt;X-PINGOTHER&lt;/code&gt; and &lt;code&gt;Content-Type&lt;/code&gt; HTTP headers in the
subsequent request.&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;label&quot;&gt;Example response headers&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Allow-Origin&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;https://example.com&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Allow-Credentials&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;true&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Allow-Methods&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;POST, GET, OPTIONS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Allow-Headers&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;X-PINGOTHER, Content-Type&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Access-Control-Max-Age&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;86400&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Access-Control-Allow-Methods: POST, GET, OPTIONS&lt;/code&gt; indicates that subsequent
requests can be made with the  &lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;OPTIONS&lt;/code&gt; methods.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Access-Control-Allow-Headers: X-PINGOTHER, Content-Type&lt;/code&gt; indicates subsequent
requests can include the &lt;code&gt;X-PINGOTHER&lt;/code&gt; and &lt;code&gt;Content-Type&lt;/code&gt; headers.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Access-Control-Max-Age: 86400&lt;/code&gt;  indicates that the result of the preflighted
request can be cached for 86400 seconds.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;supported-browsers-7&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers-7&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome 4, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      4
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Firefox 3.5, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      3.5
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Edge 12, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      12
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Safari 4, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      4
    &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;a class=&quot;wdi-browser-compat__link&quot; href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Access-Control-Allow-Origin#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;h3 id=&quot;learn-more-7&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more-7&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/cross-origin-resource-sharing/&quot;&gt;Cross-Origin Resource Sharing (CORS)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/CORS&quot; rel=&quot;noopener&quot;&gt;Cross-Origin Resource Sharing (CORS) - HTTP |
MDN&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;coep&quot;&gt;Cross-Origin Embedder Policy (COEP) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#coep&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To reduce the ability of &lt;a href=&quot;https://en.wikipedia.org/wiki/Spectre_(security_vulnerability)&quot; rel=&quot;noopener&quot;&gt;Spectre-based
attacks&lt;/a&gt; to
steal cross-origin resources, features such as &lt;code&gt;SharedArrayBuffer&lt;/code&gt; or
&lt;code&gt;performance.measureUserAgentSpecificMemory()&lt;/code&gt; are disabled by default.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Cross-Origin-Embedder-Policy: require-corp&lt;/code&gt; prevents documents and workers from
loading cross-origin resources such as images, scripts, stylesheets, iframes and
others unless these resources explicitly opt into being loaded via &lt;a href=&quot;https://web.dev/security-headers/#cors&quot;&gt;CORS&lt;/a&gt;
or &lt;a href=&quot;https://web.dev/security-headers/#corp&quot;&gt;CORP&lt;/a&gt; headers. COEP can be combined with&lt;code&gt;Cross-Origin-Opener-Policy&lt;/code&gt;
to opt a document into &lt;a href=&quot;https://web.dev/cross-origin-isolation-guide/&quot;&gt;cross-origin isolation&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Use &lt;code&gt;Cross-Origin-Embedder-Policy: require-corp&lt;/code&gt; when you want to enable
&lt;a href=&quot;https://web.dev/coop-coep/&quot;&gt;cross-origin isolation&lt;/a&gt; for your document.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example usage&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Embedder-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;require-corp&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use COEP
&lt;/summary&gt;
&lt;h3 id=&quot;example-usages&quot;&gt;Example usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#example-usages&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;COEP takes a single value of &lt;code&gt;require-corp&lt;/code&gt;. By sending this header, you can
instruct the browser to block loading resources that do not opt-in via
&lt;a href=&quot;https://web.dev/security-headers/#cors&quot;&gt;CORS&lt;/a&gt; or &lt;a href=&quot;https://web.dev/security-headers/#corp&quot;&gt;CORP&lt;/a&gt;.&lt;/p&gt;
&lt;img alt=&quot;How COEP works&quot; decoding=&quot;async&quot; height=&quot;410&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/admin/MAhaVZdShm8tRntWieU4.png?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;p&gt;You can try how the following configurations affect loading resources on &lt;a href=&quot;https://cross-origin-isolation.glitch.me/&quot; rel=&quot;noopener&quot;&gt;this
demo&lt;/a&gt;. Change the
&lt;strong&gt;Cross-Origin-Embedder-Policy&lt;/strong&gt; dropdown menu, the
&lt;strong&gt;Cross-Origin-Resource-Policy&lt;/strong&gt; dropdown menu, the &lt;strong&gt;Report Only&lt;/strong&gt; checkbox etc
to see how they affect loading resources. Also, open &lt;a href=&quot;https://reporting-endpoint.glitch.me/&quot; rel=&quot;noopener&quot;&gt;the reporting endpoint
demo&lt;/a&gt; to see if the blocked resources are
reported.&lt;/p&gt;
&lt;h4 id=&quot;enable-cross-origin-isolation&quot;&gt;Enable cross-origin isolation &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#enable-cross-origin-isolation&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;Enable &lt;a href=&quot;https://web.dev/coop-coep&quot;&gt;cross-origin isolation&lt;/a&gt; by sending
&lt;code&gt;Cross-Origin-Embedder-Policy: require-corp&lt;/code&gt; along with
&lt;code&gt;Cross-Origin-Opener-Policy: same-origin&lt;/code&gt;.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Embedder-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;require-corp&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Opener-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;same-origin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h4 id=&quot;report-resources-incompatible-withn-coep&quot;&gt;Report resources incompatible withn COEP &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#report-resources-incompatible-withn-coep&quot;&gt;#&lt;/a&gt;&lt;/h4&gt;
&lt;p&gt;You can receive reports of blocked resources caused by COEP with the Reporting
API.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Embedder-Policy&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;require-corp; report-to=&quot;coep&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;COEP also supports report-only mode so you can receive reports without actually
blocking loading resources.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Cross-Origin-Embedder-Policy-Report-Only&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value&quot;&gt;require-corp; report-to=&quot;coep&quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h3 id=&quot;supported-browsers-8&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers-8&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome 83, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      83
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Firefox 79, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      79
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Edge 83, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      83
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Safari 15.2, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      15.2
    &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;a class=&quot;wdi-browser-compat__link&quot; href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;h3 id=&quot;learn-more-8&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more-8&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/coop-coep/&quot;&gt;Making your website &amp;quot;cross-origin isolated&amp;quot; using COOP and COEP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/why-coop-coep/&quot;&gt;Why you need &amp;quot;cross-origin isolated&amp;quot; for powerful features&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://web.dev/cross-origin-isolation-guide/&quot;&gt;A guide to enable cross-origin isolation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;hsts&quot;&gt;HTTP Strict Transport Security (HSTS) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#hsts&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Communication over a plain HTTP connection is not encrypted, making the
transferred data accessible to network-level eavesdroppers.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Strict-Transport-Security&lt;/code&gt; header informs the browser that it should never load
the site using HTTP and use HTTPS instead. Once it&#39;s set, the browser will use
HTTPS instead of HTTP to access the domain without a redirect for a duration
defined in the header.&lt;/p&gt;
&lt;p class=&quot;label&quot;&gt;Example usage&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Strict-Transport-Security&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value hsts languages-hsts&quot;&gt;max-age=31536000&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;details&gt;
&lt;summary&gt;
  How to use HSTS
&lt;/summary&gt;
&lt;h3 id=&quot;recommended-usages-8&quot;&gt;Recommended usages &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#recommended-usages-8&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;All websites that transition from HTTP to HTTPS should respond with a
&lt;code&gt;Strict-Transport-Security&lt;/code&gt; header when a request with HTTP is received.&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-http&quot;&gt;&lt;code class=&quot;language-http&quot;&gt;&lt;span class=&quot;token header&quot;&gt;&lt;span class=&quot;token header-name keyword&quot;&gt;Strict-Transport-Security&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;token header-value hsts languages-hsts&quot;&gt;max-age=31536000&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h3 id=&quot;supported-browsers-9&quot;&gt;Supported browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#supported-browsers-9&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome 4, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      4
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Firefox 4, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      4
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Edge 12, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      12
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Safari 7, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      7
    &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;a class=&quot;wdi-browser-compat__link&quot; href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;h3 id=&quot;learn-more-9&quot;&gt;Learn more &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#learn-more-9&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security&quot; rel=&quot;noopener&quot;&gt;Strict-Transport-Security -
HTTP&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/details&gt;
&lt;h2 id=&quot;further-reading&quot;&gt;Further reading &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/security-headers/#further-reading&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://www.w3.org/TR/post-spectre-webdev/&quot; rel=&quot;noopener&quot;&gt;Post-Spectre Web Development&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>
    <author>
      <name>Eiji Kitamura</name>
    </author><author>
      <name>Maud Nalpas</name>
    </author><author>
      <name>Artur Janc</name>
    </author>
  </entry>
</feed>
