I get error when calling http site from https site

46,755 views
Skip to first unread message

Jason Lu

unread,
Jan 31, 2015, 11:12:56 PM1/31/15
to chromium-...@chromium.org
Get error:


myscript.js:287 Mixed Content: The page at 'https://scholar.google.com.hk/scholar?q=vertical+mixing&btnG=&hl=en&as_sdt=0%2C5' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://127.0.0.1/cogs/retrievedb_num.php?id=5895258109447570068'. This request has been blocked; the content must be served over HTTPS.myscript.js:287 retrieveDBNummyscript.js:35 (anonymous function)

myscript.js:287 Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://127.0.0.1/cogs/retrievedb_num.php?id=5895258109447570068'.

line 286 and 287 are:
    xmlhttp.open("GET","http://127.0.0.1/cogs/retrievedb_num.php?id=" + paperID, false);
    xmlhttp.send();

Two weeks ago, I can run this extension successfully. I don't know why it doesn't work suddenly.

Ziink

unread,
Feb 1, 2015, 10:17:22 AM2/1/15
to chromium-...@chromium.org
You have to channel it via the background page/script. Can't do it directly in the content script.

Yan Kou

unread,
Feb 1, 2015, 3:02:03 PM2/1/15
to chromium-...@chromium.org
Chrome doesn't allow sending HTTP request from an HTTPS page. I ran into the same problem when using localhost 127.0.0.1. After googled for a while it seems like the best way is to use an SSL certificate. I used Flask on my back-end, and I created a self-signed SSL on my localhost. For development you just need to tell Chrome this is a valid SSL when it asks you to proceed. For production you probably need to get a valid SSL certificate.

Jason Lu

unread,
Feb 1, 2015, 6:52:37 PM2/1/15
to chromium-...@chromium.org
Yep. But the weird thing is that I can run this extension two weeks ago. 

在 2015年2月1日星期日 UTC+8下午12:12:56,Jason Lu写道:

Jayati Jaiswal

unread,
Aug 18, 2015, 3:49:42 AM8/18/15
to Chromium-extensions
Hi Ziink,

I am running into the same problem. How can I channel it via background page/script? 

Tapan Anand

unread,
Aug 21, 2015, 6:27:09 AM8/21/15
to Chromium-extensions
Reply all
Reply to author
Forward
0 new messages