Home » Php » php – The page at [url] ran insecure content from [url] in chrome

php – The page at [url] ran insecure content from [url] in chrome

Posted by: admin July 12, 2020 Leave a comment

Questions:

When i open a link this shows following message in chrome
[blocked] The page at https://www.loadmytrailer.com/beta/postload.php ran insecure content from http://code.jquery.com/ui/1.10.2/jquery-ui.js.
but run fine in firefox.

[I googled it and found that when your site run on Secure SSL then it blocked some insecure content from external http sources. ]

So i want to loads these insecure content anyway in chrome
Please guys help me .

How to&Answers:

You can use protocol-relative URLs.The browser will use the page’s protocol to try to obtain the file. On non-secure 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

! notice absence of protocol

Answer:

That’s impossible. Chrome’s security policy won’t allow that.

Option 1:

Host the javascript you want to load remotely by yourself and link to it relatively.

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

Requesting a resource on your own server is protocol-independent

Option 2:

Use CDN’s that support SSL. (Google for example)

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

A relative protocol notation can be used to request the source with the proper protocol depending on the protocol the current resource is using (see above).


Side Note

There is a command line parameter for Chrome called “-allow-running-insecure-content”, which skips the insecure content check.

I highly advise not to use it because you can’t expect your users to have set that parameter.


Further Reading

Answer:

For testing purposes,
you could activate loading of insecure content by clicking the “shield” icon which would appear on the address bar in chrome.

Answer:

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

That way, it will be delivered to visitors over SSL, and their browsers will be happy that all content has arrived securely.

Answer:

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

Link to https version if on https connection. Or host the file yourself.