Programming

How to get Chrome to allow mixed content

27 September 2026 · 10 min read

How to get Chrome to allow mixed content

Navigating the complexities of web security can sometimes feel like traversing a minefield. One common issue web developers and users alike encounter is the “mixed content” error in Chrome. This error arises when a website loaded over a secure HTTPS connection attempts to load resources (like images, scripts, or stylesheets) over an insecure HTTP connection. Chrome, in its effort to protect users from man-in-the-middle attacks and data breaches, blocks this mixed content by default. Understanding how to get Chrome to allow mixed content, while generally discouraged for security reasons, is sometimes necessary for testing environments, legacy systems, or specific internal tools. Let’s explore the reasons behind this security measure, the risks involved, and the methods to temporarily bypass it, emphasizing always prioritizing secure practices when feasible.

Understanding Chrome’s Mixed Content Blocking

Chrome’s strict stance on mixed content is a cornerstone of modern web security. When a webpage is served over HTTPS, it signifies that the communication between the user’s browser and the web server is encrypted, protecting sensitive data from interception. However, if this secure page then loads resources over HTTP, that protection is compromised. The HTTP connection is vulnerable to eavesdropping and manipulation, potentially allowing attackers to inject malicious code or steal user information. This is why Chrome actively blocks mixed content, displaying a warning message or even preventing the insecure resources from loading altogether. This behavior is not a bug, but a deliberate security feature designed to safeguard users.

The implications of mixed content extend beyond just a broken webpage. In the worst-case scenario, an attacker could inject malicious JavaScript into an HTTP resource loaded on an HTTPS page. This script could then steal cookies, redirect users to phishing sites, or even inject malware. According to a Google Security Blog post [External Link 1: Link to a Google Security Blog post about mixed content], “Mixed content weakens the security guarantee of HTTPS and allows attackers to tamper with the page.” This is why developers should always strive to serve all resources over HTTPS and avoid mixed content at all costs. The presence of mixed content not only poses a security risk but also negatively impacts the website’s search engine ranking, as search engines prioritize secure websites.

Chrome differentiates between “mixed passive content” and “mixed active content.” Passive content, like images, can be blocked without directly compromising the page’s functionality, although it may affect its appearance. Active content, such as scripts and stylesheets, poses a more significant threat because it can directly alter the behavior of the page. Chrome typically blocks mixed active content by default, while mixed passive content may be allowed with a warning or blocked depending on the browser settings and the specific resource. The key takeaway is that mixed content introduces vulnerabilities that should be addressed by migrating all resources to HTTPS.

Temporarily Allowing Mixed Content in Chrome

While strongly discouraged in production environments, there are situations where temporarily allowing mixed content in Chrome becomes necessary, such as during development, testing, or when dealing with legacy systems that haven’t been fully migrated to HTTPS. There are several methods to achieve this, each with its own caveats. It’s crucial to remember that these methods should only be used in controlled environments where the risks are understood and mitigated.

One of the simplest methods is to use the browser’s built-in developer tools. By opening the Chrome DevTools (usually by pressing F12 or right-clicking on the page and selecting “Inspect”), you can navigate to the “Security” tab. This tab often provides information about mixed content issues and allows you to temporarily disable mixed content blocking for the current session. However, this setting is not persistent and will reset when you close the browser. This is a convenient option for quick testing and debugging, but not a solution for long-term use. Ensure you understand the security implications before disabling these protections.

Another approach is to use Chrome’s command-line flags. When launching Chrome from the command line, you can specify the –allow-running-insecure-content flag. This flag instructs Chrome to allow mixed content on all websites. However, this method is generally not recommended due to the security risks it poses. It effectively disables a critical security feature and exposes you to potential attacks. It’s far better to resolve the underlying mixed content issues rather than resorting to this workaround. According to web security expert Troy Hunt [External Link 2: Link to Troy Hunt’s blog or article about mixed content], “Disabling security features should always be a last resort, as it undermines the very foundation of a secure web experience.”

Best Practices for Resolving Mixed Content Issues

The most effective and secure solution to mixed content problems is to eliminate them altogether. This involves migrating all resources to HTTPS and ensuring that your website only loads content over secure connections. There are several steps you can take to achieve this.

First, identify all mixed content on your website. Chrome’s developer tools can help you pinpoint these resources. The “Security” tab will flag any insecurely loaded content, providing you with the URLs of the offending resources. Once you have identified the mixed content, you can begin the process of migrating them to HTTPS. This may involve updating links in your HTML code, configuring your web server to serve resources over HTTPS, or finding HTTPS alternatives for third-party resources.

Next, update all links to use HTTPS. In your HTML code, replace any HTTP URLs with their HTTPS equivalents. This includes links to images, scripts, stylesheets, and other resources. You can use a search and replace tool to automate this process, but be sure to verify that all links have been updated correctly. It’s also important to update any links in your database or content management system (CMS). This ensures that new content is also served over HTTPS. Consider using a Content Security Policy (CSP) to enforce HTTPS and prevent future mixed content errors.

Finally, configure your web server to redirect HTTP traffic to HTTPS. This ensures that users who accidentally visit the HTTP version of your website are automatically redirected to the secure HTTPS version. This can be done using a .htaccess file (for Apache servers) or a similar configuration file for other web servers. This also provides a better user experience by ensuring that visitors are always accessing the secure version of your site. Implementing these best practices will significantly improve your website’s security and protect your users from potential attacks. According to a study by the HTTP Archive [External Link 3: Link to HTTP Archive’s study on HTTPS adoption], “Websites that fully embrace HTTPS demonstrate a stronger commitment to user security and are more likely to be trusted by visitors.”

Troubleshooting Common Mixed Content Problems

Even after implementing the best practices, you might still encounter mixed content issues. Here are some common problems and their solutions:

  • Problem: Third-party resources are still loading over HTTP.
  • Solution: Look for HTTPS alternatives for these resources or host them on your own server over HTTPS.
  • Problem: Some images are still loading over HTTP.
  • Solution: Update the image URLs to use HTTPS or re-upload the images to your server over HTTPS.

Another common issue is related to caching. Sometimes, even after updating all links to HTTPS, the browser might still load resources from the cache over HTTP. To resolve this, try clearing your browser’s cache or using a cache-busting technique, such as adding a version number to the end of the resource URL (e.g., style.css?v=1). This forces the browser to download the latest version of the resource. You should also test your website on different browsers and devices to ensure that it’s working correctly across all platforms.

Here’s a summarized list of steps to troubleshoot mixed content:

  1. Identify mixed content using Chrome DevTools.
  2. Update all HTTP links to HTTPS in your HTML, CSS, and JavaScript files.
  3. Configure your web server to redirect HTTP to HTTPS.
  4. Clear your browser’s cache and test your website.
  5. Consider using a Content Security Policy (CSP) to prevent future mixed content errors.

Properly configuring your Content Security Policy (CSP) is crucial for preventing mixed content errors. A CSP allows you to define which sources are allowed to load resources on your website. By specifying https: as the only allowed scheme, you can effectively prevent mixed content from ever occurring. This provides an additional layer of security and helps to ensure that your website is always served over HTTPS. You can use the CSP generator to create a policy for your website.

Infographic here
FAQ: Mixed Content in Chrome ----------------------------
What is mixed content?
Mixed content occurs when a website loaded over a secure HTTPS connection loads resources (like images, scripts, or stylesheets) over an insecure HTTP connection.
Why does Chrome block mixed content?
Chrome blocks mixed content to protect users from man-in-the-middle attacks and data breaches. Insecure HTTP connections can be intercepted and manipulated by attackers.
Is it safe to allow mixed content in Chrome?
Allowing mixed content in Chrome is generally not safe and should only be done in controlled environments, such as during development or testing. It weakens the security of the HTTPS connection and exposes you to potential attacks.
How can I fix mixed content issues on my website?
The best way to fix mixed content issues is to migrate all resources to HTTPS and ensure that your website only loads content over secure connections. This involves updating links, configuring your web server, and using a Content Security Policy (CSP).
Ultimately, understanding how to get Chrome to allow mixed content is less about bypassing security and more about understanding the underlying security principles. While temporary solutions might be needed in specific development or testing scenarios, the long-term goal should always be to eliminate mixed content entirely. By migrating all resources to HTTPS, configuring your web server correctly, and implementing a strong Content Security Policy, you can ensure that your website is secure and protects your users from potential attacks. This approach enhances user trust, improves SEO rankings, and contributes to a safer web environment for everyone. Don't just work around the problem – solve it! Embrace HTTPS fully, and you'll not only resolve mixed content issues but also fortify your website's overall security posture. Explore resources on website security best practices to further safeguard your digital assets.

Question & Answer :
Chrome browser by default is blocking mixed content. How do I adjust my settings/configuration to allow mixed content without making any adjustments on the UI every time?

I have found two solutions but neither of them work:

  1. Several articles say you can adjust this under the Security section of “Under the Hood” in the Options. This option no longer seems to exist. There is no Under The Hood tab and there is no such dropdown to adjust how Chrome handles mixed content as far as I can tell.
  2. Another option is to add the --allow-running-insecure-content flag to your command line. I did this like so: "C:\Program Files\Google\Chrome\Application\chrome.exe" --allow-running-insecure-content. However this made no difference. If I tried adding the flag inside the double quotes, then Windows complains saying it is invalid.

So what option do I have now with the latest version of Chrome?

Steps as of Chrome v91 (6/17/2021):

  1. Click the Not secure warning next to the URL

enter image description here

  1. Click Site settings on the popup box

enter image description here

  1. Near the bottom of the list is Insecure content, change this to Allow

enter image description here

  1. Close settings, go back to the site, and Refresh the page

Older Chrome Versions:

timmmy_42 answers this on: https://productforums.google.com/forum/#!topic/chrome/OrwppKWbKnc

In the address bar at the right end should be a ‘shield’ icon, you can click on that to run insecure content.

This worked for me in Chromium-dev Version 36.0.1933.0 (262849).