Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 .

like image 224
Dinesh Nagar Avatar asked Aug 08 '13 08:08

Dinesh Nagar


3 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

like image 78
Lixas Avatar answered Oct 29 '22 15:10

Lixas


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

  • Google Chrome Help - "This page has insecure content"
like image 13
thpl Avatar answered Oct 29 '22 13:10

thpl


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

like image 5
srj Avatar answered Oct 29 '22 14:10

srj