The page on [url] used insecure content from [url] in chrome

When I open the link, it shows the following message in chrome [locked] The https://www.loadmytrailer.com/beta/postload.php page launches insecure content from http://code.jquery.com/ui/1.10.2/ jquery-ui.js . but work fine in firefox.

[I searched for it and found that when your site runs on Secure SSL, it blocked some insecure materials from external HTTP sources. ]

So, I want to download these insecure content anyway in chrome. Please guys help me.

+7
javascript google-chrome php
source share
5 answers

You can use protocol related URLs. The browser will use the page protocol to try to get the file. On unprotected pages - http. On secure pages, it will use https.

For example, instead of:

http://code.jquery.com/ui/1.10.2/jquery-ui.js 

... you can use:

 //code.jquery.com/ui/1.10.2/jquery-ui.js 

! protocol notification

+26
source share

It's impossible. Chrome's security policy will not allow this.

Option 1:

Build the javascript that you want to download remotely yourself and relate to it relatively.

 <script type="text/javascript" src="/my/assets/js/jquery/1.10.2/jquery.min.js"></script> 

The resource request on your own server is protocol independent

Option 2:

Use a CDN that supports SSL. (E.g. Google)

 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> 

A relative protocol entry can be used to request a source with an appropriate protocol depending on the protocol that uses the current resource (see above).


Side note

Chrome uses the "-allow-running-insecure-content" command-line option, which skips checking for insecure content.

I highly recommend not using it because you cannot expect your users to set this option.


additional literature

+13
source share

For testing purposes, you can activate the download of unsafe content by clicking on the โ€œscreenโ€ icon that appears on the address bar in chrome.

+5
source share

You can try hosting jquery-ui.js on your own server, assuming you control loadmytrailer.com.

Thus, it will be delivered to visitors via SSL, and their browsers will be glad that all the content arrived reliably.

0
source share

jquery ui is also available at https: https://code.jquery.com/ui/1.10.2/jquery-ui.js

Link to https version if https connection is enabled. Or place the file yourself.

0
source share

All Articles