1

I am using a Chrome extension to display contents from a http website on a https website using the code below:

$("#div").html('<object data="http://example.com/"');

However I'm receiving this error due to mixing http and https:

Mixed Content: The page at 'https://website.com' was loaded over HTTPS, but requested an insecure plugin resource 'http://example.com/'. This request has been blocked; the content must be served over HTTPS.

How can I overcome this? The http website cannot be loaded with https.

Note: I have to use Javascript/jQuery as I am using the code in a Chrome extension.

The Codesee
  • 3,714
  • 5
  • 38
  • 78

1 Answers1

0

You can kludge it by writing a proxy script (which can reside anywhere) that can be accessed externally via HTTPS, and which retrieves the requested URL behind the scenes via HTTP.

Your extension would request:

$("#div").html('<object data="https://your-proxy-server.com/your-script">');
kmoser
  • 8,780
  • 3
  • 24
  • 40