<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>https://web.dev/</id>
  <title>Jo-el van Bergen on web.dev</title>
  <updated>2026-04-15T23:21:06Z</updated>
  <author>
    <name>Jo-el van Bergen</name>
  </author>
  <link href="https://web.dev/authors/johyphenel/feed.xml" rel="self"/>
  <link href="https://web.dev/"/>
  <icon>https://web-dev.imgix.net/image/admin/Qfxylpir4hHF23rUgEQP.jpg?auto=format</icon>
  <logo>https://web.dev/images/shared/rss-banner.png</logo>
  <subtitle>Our latest news, updates, and stories by Jo-el van Bergen.</subtitle>
  
  
  <entry>
    <title>Fixing mixed content</title>
    <link href="https://web.dev/fixing-mixed-content/"/>
    <updated>2019-09-07T00:00:00Z</updated>
    <id>https://web.dev/fixing-mixed-content/</id>
    <content type="html" mode="escaped">&lt;p&gt;Supporting HTTPS for your website is an important step to protecting your site and your users from attack,
but mixed content can render that protection useless.
Increasingly insecure mixed content will be blocked by browsers, as explained in &lt;a href=&quot;https://web.dev/what-is-mixed-content&quot;&gt;What is mixed content?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this guide we will demonstrate techniques and tools for fixing existing mixed content issues
and preventing new ones from happening.&lt;/p&gt;
&lt;h2 id=&quot;finding-mixed-content-by-visiting-your-site&quot;&gt;Finding mixed content by visiting your site &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#finding-mixed-content-by-visiting-your-site&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;When visiting an HTTPS page in Google Chrome,
the browser alerts you to mixed content as errors and warnings in the JavaScript console.&lt;/p&gt;
&lt;p&gt;In &lt;a href=&quot;https://web.dev/what-is-mixed-content&quot;&gt;What is mixed content?&lt;/a&gt;,
you can find a number of examples and see how the problems are reported in Chrome DevTools.&lt;/p&gt;
&lt;p&gt;The example of &lt;a href=&quot;https://passive-mixed-content.glitch.me/&quot; rel=&quot;noopener&quot;&gt;passive mixed content&lt;/a&gt; will give the following warnings.
If the browser is able to find the content at an &lt;code&gt;https&lt;/code&gt; URL it automatically upgrades it, then shows a message.&lt;/p&gt;
&lt;figure&gt;
  &lt;img alt=&quot;Chrome DevTools showing the warnings displayed when mixed content is detected and upgraded&quot; decoding=&quot;async&quot; height=&quot;294&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/Y7b4EWAbSL6BgI07FdQq.jpg?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;a href=&quot;https://active-mixed-content.glitch.me/&quot; rel=&quot;noopener&quot;&gt;Active mixed content&lt;/a&gt; is blocked and displays a warning.&lt;/p&gt;
&lt;figure&gt;
  &lt;img alt=&quot;Chrome DevTools showing the warnings displayed when active mixed content is blocked&quot; decoding=&quot;async&quot; height=&quot;304&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/KafrfEz1adCP2eUHQEWy.jpg?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;/figure&gt;
&lt;p&gt;If you find warnings like these for &lt;code&gt;http://&lt;/code&gt; URLs on your site,
you need to fix them in your site&#39;s source.
It&#39;s helpful to make a list of these URLs, along with the page you found them on, for use when you fix them.&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; Mixed content errors and warnings are only shown for the page you are currently viewing, and the JavaScript console is cleared every time you navigate to a new  page. This means you will have to view every page of your site individually to find these errors. &lt;/div&gt;&lt;/aside&gt;
&lt;h3 id=&quot;finding-mixed-content-in-your-site&quot;&gt;Finding mixed content in your site &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#finding-mixed-content-in-your-site&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can search for mixed content directly in your source code.
Search for &lt;code&gt;http://&lt;/code&gt; in your source and look for tags that include HTTP URL attributes.
Note that having &lt;code&gt;http://&lt;/code&gt; in the &lt;code&gt;href&lt;/code&gt; attribute of anchor tags (&lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;)
is often not a mixed content issue, with some notable exceptions discussed later.&lt;/p&gt;
&lt;p&gt;If your site is published using a content management system,
it is possible that links to insecure URLs are inserted when pages are published.
For example, images may be included with a full URL rather than a relative path.
You will need to find and fix these within the CMS content.&lt;/p&gt;
&lt;h3 id=&quot;fixing-mixed-content&quot;&gt;Fixing mixed content &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#fixing-mixed-content&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Once you&#39;ve found mixed content in your site&#39;s source,
you can follow these steps to fix it.&lt;/p&gt;
&lt;p&gt;If you get a console message that a resource request has been automatically upgraded from HTTP to HTTPS,
you can safely change the &lt;code&gt;http://&lt;/code&gt; URL for the resource in your code to &lt;code&gt;https://&lt;/code&gt;.
You can also check to see if a resource is available securely by changing &lt;code&gt;http://&lt;/code&gt; to &lt;code&gt;https://&lt;/code&gt; in the browser URL bar
and attempting to open the URL in a browser tab.&lt;/p&gt;
&lt;p&gt;If the resource is not available via &lt;code&gt;https://&lt;/code&gt;, you should consider one of the following options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Include the resource from a different host, if one is available.&lt;/li&gt;
&lt;li&gt;Download and host the content on your site directly, if you are legally allowed to do so.&lt;/li&gt;
&lt;li&gt;Exclude the resource from your site altogether.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Having fixed the problem,
view the page where you found the error originally and verify that the error no longer appears.&lt;/p&gt;
&lt;h3 id=&quot;beware-of-non-standard-tag-usage&quot;&gt;Beware of non-standard tag usage &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#beware-of-non-standard-tag-usage&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Beware of non-standard tag usage on your site.
For instance, anchor (&lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;) tag URLs don&#39;t result in mixed content errors,
as they cause the browser to navigate to a new page.
This means they usually don&#39;t need to be fixed.
However some image gallery scripts override the functionality of the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt;
tag and load the HTTP resource specified by the &lt;code&gt;href&lt;/code&gt; attribute into a lightbox display on the page,
causing a mixed content problem.&lt;/p&gt;
&lt;h2 id=&quot;handle-mixed-content-at-scale&quot;&gt;Handle mixed content at scale &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#handle-mixed-content-at-scale&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The manual steps above work well for smaller websites;
but for large websites or sites with many separate development teams,
it can be tough to keep track of all the content being loaded.
To help with this task, you can use content security policy
to instruct the browser to notify you about mixed content and ensure that your pages never unexpectedly load insecure resources.&lt;/p&gt;
&lt;h3 id=&quot;content-security-policy&quot;&gt;Content security policy &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#content-security-policy&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://web.dev/csp/&quot;&gt;Content security policy&lt;/a&gt; (CSP)
is a multi-purpose browser feature that you can use to manage mixed content at scale.
The CSP reporting mechanism can be used to track mixed content on your site,
and provide enforcement policies to protect users by upgrading or blocking mixed content.&lt;/p&gt;
&lt;p&gt;You can enable these features for a page by including the
&lt;code&gt;Content-Security-Policy&lt;/code&gt; or &lt;code&gt;Content-Security-Policy-Report-Only&lt;/code&gt; header in the response sent from your server.
Additionally you can set &lt;code&gt;Content-Security-Policy&lt;/code&gt;
(though &lt;strong&gt;not&lt;/strong&gt; &lt;code&gt;Content-Security-Policy-Report-Only&lt;/code&gt;) using a &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tag in the &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt; section of your page.&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; Modern browsers enforce all content security policies that they receive. Multiple CSP header values received by the browser in the response header or &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; elements are combined and enforced as a single policy; reporting policies are likewise combined. Policies are combined by taking the intersection of the policies; that is to say, each policy after the first can only further restrict the allowed content, not broaden it. &lt;/div&gt;&lt;/aside&gt;
&lt;h3 id=&quot;finding-mixed-content-with-content-security-policy&quot;&gt;Finding mixed content with content security policy &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#finding-mixed-content-with-content-security-policy&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;You can use content security policy to collect reports of mixed content on your site.
To enable this feature, set the &lt;code&gt;Content-Security-Policy-Report-Only&lt;/code&gt; directive by adding it as a response header for your site.&lt;/p&gt;
&lt;p&gt;Response header:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Content-Security-Policy-Report-Only: default-src https: &#39;unsafe-inline&#39; &#39;unsafe-eval&#39;; report-uri https://example.com/reportingEndpoint&lt;/code&gt;&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; The &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/report-uri&quot;&gt;report-uri&lt;/a&gt; response header is being deprecated in favor of &lt;a href=&quot;https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy/report-to&quot;&gt;report-to&lt;/a&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 70, 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; 70 &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;/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, 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;/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/Content-Security-Policy/report-to#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt; &lt;/div&gt;  You can provide both headers, in which case &lt;code&gt;report-uri&lt;/code&gt; will be ignored if the browser supports &lt;code&gt;report-to&lt;/code&gt;. &lt;/div&gt;&lt;/aside&gt;
&lt;p&gt;Whenever a user visits a page on your site,
their browser sends JSON-formatted reports regarding anything that violates the content security policy to
&lt;code&gt;https://example.com/reportingEndpoint&lt;/code&gt;.
In this case, anytime a subresource is loaded over HTTP, a report is sent.
These reports include the page URL where the policy violation occurred and the subresource URL that violated the policy.
If you configure your reporting endpoint to log these reports,
you can track the mixed content on your site without visiting each page yourself.&lt;/p&gt;
&lt;p&gt;The two caveats to this are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Users have to visit your page in a browser that understands the CSP header. This is true for most modern browsers.&lt;/li&gt;
&lt;li&gt;You only get reports for pages visited by your users.
So if you have pages that don&#39;t get much traffic,
it might be some time before you get reports for your entire site.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;a href=&quot;https://web.dev/csp/&quot;&gt;Content security policy&lt;/a&gt;
guide has more information and an example endpoint.&lt;/p&gt;
&lt;h3 id=&quot;alternatives-to-reporting-with-csp&quot;&gt;Alternatives to reporting with CSP &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#alternatives-to-reporting-with-csp&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;If your site is hosted for you by a platform such as Blogger,
you may not have access to modify headers and add a CSP.
Instead, a viable alternative could be to use a website crawler to find issues across your site for you, such as
&lt;a href=&quot;https://httpschecker.net/how-it-works#httpsChecker&quot; rel=&quot;noopener&quot;&gt;HTTPSChecker&lt;/a&gt;
or
&lt;a href=&quot;https://github.com/bramus/mixed-content-scan&quot; rel=&quot;noopener&quot;&gt;Mixed Content Scan&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&quot;upgrading-insecure-requests&quot;&gt;Upgrading insecure requests &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/fixing-mixed-content/#upgrading-insecure-requests&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 44, 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;
      44
    &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 48, 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;
      48
    &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 17, 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;
      17
    &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 10.1, 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;
      10.1
    &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/Upgrade-Insecure-Requests#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Browsers are beginning to upgrade and block insecure requests.
You can use CSP directives to force automatic upgrading or blocking of these assets.&lt;/p&gt;
&lt;p&gt;The &lt;a href=&quot;https://www.w3.org/TR/upgrade-insecure-requests/&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;upgrade-insecure-requests&lt;/code&gt;&lt;/a&gt;
CSP directive instructs the browser to upgrade insecure URLs before making network requests.&lt;/p&gt;
&lt;p&gt;As an example, if a page contains an image tag with an HTTP URL such as
&lt;code&gt;&amp;lt;img src=&amp;quot;http://example.com/image.jpg&amp;quot;&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The browser instead makes a secure request for
&lt;code&gt;https://example.com/image.jpg&lt;/code&gt;, thus saving the user from mixed content.&lt;/p&gt;
&lt;p&gt;You can enable this behavior either by sending a &lt;code&gt;Content-Security-Policy&lt;/code&gt; header with this directive:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-markup&quot;&gt;&lt;code class=&quot;language-markup&quot;&gt;Content-Security-Policy: upgrade-insecure-requests&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Or by embedding that same directive inline in the document&#39;s &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;
section using a &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; element:&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;meta&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;http-equiv&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;Content-Security-Policy&lt;span class=&quot;token punctuation&quot;&gt;&quot;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token attr-name&quot;&gt;content&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;upgrade-insecure-requests&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;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;As with browser automatic upgrading, if the resource is not available over HTTPS,
the upgraded request fails and the resource is not loaded.
This maintains the security of your page. The &lt;code&gt;upgrade-insecure-requests&lt;/code&gt; directive will go further than automatic browser upgrading,
attempting to upgrade requests that the browser currently does not.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;upgrade-insecure-requests&lt;/code&gt; directive cascades into &lt;code&gt;&amp;lt;iframe&amp;gt;&lt;/code&gt; documents,
ensuring the entire page is protected.&lt;/p&gt;
</content>
    <author>
      <name>Jo-el van Bergen</name>
    </author><author>
      <name>Rachel Andrew</name>
    </author>
  </entry>
  
  <entry>
    <title>What is mixed content?</title>
    <link href="https://web.dev/what-is-mixed-content/"/>
    <updated>2019-09-07T00:00:00Z</updated>
    <id>https://web.dev/what-is-mixed-content/</id>
    <content type="html" mode="escaped">&lt;p&gt;&lt;strong&gt;Mixed content&lt;/strong&gt; occurs when initial HTML is loaded over a secure
&lt;a href=&quot;https://web.dev/why-https-matters/&quot;&gt;HTTPS&lt;/a&gt; connection, but other resources (such as images,
videos, stylesheets, scripts) are loaded over an insecure HTTP connection.
This is called mixed content
because both HTTP and HTTPS content are being loaded to display the same page,
and the initial request was secure over HTTPS.&lt;/p&gt;
&lt;p&gt;Requesting subresources using the insecure HTTP protocol weakens the security of the entire page,
as these requests are vulnerable to &lt;a href=&quot;https://www.ietf.org/rfc/rfc7835.html#section-2.1.1&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;on-path attacks&lt;/strong&gt;&lt;/a&gt;,
where an attacker eavesdrops on a network connection and views or modifies the communication between two parties.
Using these resources, attackers can track users and replace content on a website,
and in the case of active mixed content, take complete control over the page, not just the insecure resources.&lt;/p&gt;
&lt;p&gt;Although many browsers report mixed content warnings to the user,
by the time this happens, it is too late:
the insecure requests have already been performed and the security of the page is compromised.&lt;/p&gt;
&lt;p&gt;This is why browsers are increasingly blocking mixed content.
If you have mixed content on your site,
then fixing it will ensure the content continues to load as browsers become more strict.&lt;/p&gt;
&lt;h2 id=&quot;the-two-types-of-mixed-content&quot;&gt;The two types of mixed content &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/what-is-mixed-content/#the-two-types-of-mixed-content&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The two types of mixed content are: active and passive.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Passive mixed content&lt;/strong&gt; refers to content that doesn&#39;t interact with the rest of the page,
and thus a man-in-the-middle attack is restricted to what they can do if they intercept or change that content.
Passive mixed content is defined as images, video, and audio content.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Active mixed content&lt;/strong&gt; interacts with the page as a whole and allows an attacker to do almost anything with the page.
Active mixed content includes scripts, stylesheets, iframes,
and other code that the browser can download and execute.&lt;/p&gt;
&lt;h3 id=&quot;passive-mixed-content&quot;&gt;Passive mixed content &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/what-is-mixed-content/#passive-mixed-content&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Passive mixed content is seen as less problematic yet still poses a security threat to your site and your users.
For example, an attacker can intercept HTTP requests for images on your site and swap or replace these images;
the attacker can swap the &lt;em&gt;save&lt;/em&gt; and &lt;em&gt;delete&lt;/em&gt; button images,
causing your users to delete content without intending to;
replace your product diagrams with lewd or pornographic content,
defacing your site; or replace your product pictures with ads for a different site or product.&lt;/p&gt;
&lt;p&gt;Even if the attacker doesn&#39;t alter the content of your site,
an attacker can track users via mixed content requests.
The attacker can tell which pages a user visits and which products they view based on images or other resources that the browser loads.&lt;/p&gt;
&lt;p&gt;If passive mixed content is present most browsers will indicate in the URL bar that the page is not secure,
even when the page itself was loaded over HTTPS.
You can observe this behavior with this &lt;a href=&quot;https://passive-mixed-content.glitch.me/&quot; rel=&quot;noopener&quot;&gt;demo&lt;/a&gt;
that contains examples of passive mixed content.&lt;/p&gt;
&lt;p&gt;Until recently passive mixed content was loaded in all browsers,
as to block it would have broken many websites.
This is now beginning to change and so it is vital to update any instances of mixed content on your site.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html&quot; rel=&quot;noopener&quot;&gt;Chrome is currently rolling out&lt;/a&gt;
automatic upgrading of passive mixed content where possible.
Automatic upgrading means that if the asset is available over HTTPS, but has been hardcoded as HTTP,
the browser will load the HTTPS version. If no secure version can be found the asset will not load.&lt;/p&gt;
&lt;p&gt;Whenever it detects mixed content or auto-upgrades passive mixed content,
Chrome logs detailed messages to the &lt;strong&gt;Issues&lt;/strong&gt; tab in DevTools
to guide you on how to fix the specific issue.&lt;/p&gt;
&lt;figure&gt;
  &lt;img alt=&quot;The Issues tab in Chrome DevTools shows detailed information about the specific mixed content issue and how to fix it&quot; decoding=&quot;async&quot; height=&quot;310&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/HNxoomaHi2ksvYHGuNiE.jpg?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;/figure&gt;
&lt;h3 id=&quot;active-mixed-content&quot;&gt;Active mixed content &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/what-is-mixed-content/#active-mixed-content&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Active mixed content poses a greater threat than passive mixed content.
An attacker can intercept and rewrite active content,
thereby taking full control of your page or even your entire website.
This allows the attacker to change anything about the page,
including displaying entirely different content,
stealing user passwords or other login credentials,
stealing user session cookies,
or redirecting the user to a different site entirely.&lt;/p&gt;
&lt;p&gt;Due to the severity of this threat,
most browsers already block this type of content by default to protect users,
but functionality varies between browser vendors and versions.&lt;/p&gt;
&lt;p&gt;This other &lt;a href=&quot;https://active-mixed-content.glitch.me/&quot; rel=&quot;noopener&quot;&gt;demo&lt;/a&gt; contains examples of active mixed content.
&lt;a href=&quot;http://active-mixed-content.glitch.me/&quot; rel=&quot;noopener&quot;&gt;Load the example over HTTP&lt;/a&gt;
to see the content that&#39;s blocked when you &lt;a href=&quot;https://active-mixed-content.glitch.me/&quot; rel=&quot;noopener&quot;&gt;load the example over
HTTPS&lt;/a&gt;. Blocked content will also
be detailed in the &lt;strong&gt;Issues&lt;/strong&gt; tab.&lt;/p&gt;
&lt;figure&gt;
  &lt;img alt=&quot;The Issues tab in Chrome DevTools shows detailed information about the specific mixed content issue and how to fix it&quot; decoding=&quot;async&quot; height=&quot;361&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 800px) 800px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=964 964w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=1098 1098w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=1252 1252w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=1428 1428w, https://web-dev.imgix.net/image/tcFciHGuF3MxnTr1y5ue01OGLBn2/xRG5zpKLr0Z3OwfYpn2H.jpg?auto=format&amp;w=1600 1600w&quot; width=&quot;800&quot; /&gt;
&lt;/figure&gt;
&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt; Browsers also highlight blocked content in their DevTools. Blocked content issues are detailed in the &lt;strong&gt;Issues&lt;/strong&gt; tab in Chromium-based browsers. Firefox and Safari log messages in the console. &lt;/div&gt;&lt;/aside&gt;
&lt;h2 id=&quot;the-mixed-content-specification&quot;&gt;The mixed content specification &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/what-is-mixed-content/#the-mixed-content-specification&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Browsers follow the &lt;a href=&quot;https://w3c.github.io/webappsec-mixed-content/&quot; rel=&quot;noopener&quot;&gt;mixed content specification&lt;/a&gt;,
which defines the &lt;a href=&quot;https://w3c.github.io/webappsec-mixed-content/#optionally-blockable-mixed-content&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;optionally blockable content&lt;/strong&gt;&lt;/a&gt;
and &lt;a href=&quot;https://w3c.github.io/webappsec-mixed-content/#category-blockable&quot; rel=&quot;noopener&quot;&gt;&lt;strong&gt;blockable content&lt;/strong&gt;&lt;/a&gt; categories.&lt;/p&gt;
&lt;p&gt;From the spec,
a resource qualifies as optionally blockable content
&amp;quot;when the risk of allowing its usage as mixed content is outweighed by the risk of breaking significant portions of the web&amp;quot;;
this is a subset of the passive mixed content category described above.&lt;/p&gt;
&lt;p&gt;All content that is not &lt;strong&gt;optionally blockable&lt;/strong&gt; is considered &lt;strong&gt;blockable&lt;/strong&gt;,
and should be blocked by the browser.&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; There is a &lt;a href=&quot;https://w3c.github.io/webappsec-mixed-content/level2.html&quot;&gt;Level 2 of the Mixed Content specification&lt;/a&gt; in progress, which will add automatic upgrading to the spec. &lt;/div&gt;&lt;/aside&gt;
&lt;p&gt;In recent years, &lt;a href=&quot;https://transparencyreport.google.com/https/overview&quot; rel=&quot;noopener&quot;&gt;HTTPS usage has risen dramatically&lt;/a&gt;,
and has become the clear default on the web.
This makes it more feasible now for browsers to consider blocking all mixed content,
even those subresource types defined in the &lt;a href=&quot;https://w3c.github.io/webappsec/specs/mixedcontent/&quot; rel=&quot;noopener&quot;&gt;mixed content specification&lt;/a&gt; as &lt;strong&gt;optionally blockable&lt;/strong&gt;.
This is why we now see Chrome taking a stricter approach to these subresources.&lt;/p&gt;
&lt;h3 id=&quot;older-browsers&quot;&gt;Older browsers &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/what-is-mixed-content/#older-browsers&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;It is important to remember that not every visitor to your website uses the most up-to-date browsers.
Different versions from different browser vendors each treat mixed content differently.
At worst, older browsers and versions don&#39;t block any mixed content at all,
which is very unsafe for the user.&lt;/p&gt;
&lt;p&gt;By fixing your mixed content problems you ensure that your content is visible in new browsers.
You also help protect users from dangerous content that isn&#39;t blocked by older browsers.&lt;/p&gt;
</content>
    <author>
      <name>Jo-el van Bergen</name>
    </author><author>
      <name>Rachel Andrew</name>
    </author>
  </entry>
</feed>
