0

I was experimenting with github after building a little webapp as a project for free code camp. After hosting it on github pages it shows up broken. Most of its content is blocked. This is the link https://mojojojo77.github.io/ On mozila it says that the connection is secure but "firefox has blocked parts of this page which are not secure." I looked into the console for the problem and the API's I used seem to be cause. Is there a way to bypass this ? Like asking the user for permissions.

  • I'm actually not seeing any error messages, in Firefox or Chrome. Perhaps it has to do with a firewall setting? Maybe see if anyone else is able to access it, outside of your network? – Jake Jul 12 '16 at 20:26
  • I tried, still some part of the website doesn't load properly. – Osho SArAF Jul 13 '16 at 16:18
  • @OshoSArAF, were you able to get this working using the answer below? – ChrisGPT was on strike Jul 18 '16 at 00:06
  • @Chris After doing a bit of a research I found out that the API I used was using the http not the https protocol which [Blocked loading mixed active content](https://developer.mozilla.org/en-US/docs/Web/Security/Mixed_content) and a problem with the CORS [No Access-Control-Allow-Origin header is present on the requested resource] (https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS). The below solution worked fine until I hosted it on the Github. As a quick fix I used a [CORS proxy] (https://crossorigin.me/) which solved both of my problems. – Osho SArAF Jul 18 '16 at 21:05
  • @Chris If you have a better solution, let me know – Osho SArAF Jul 18 '16 at 21:11
  • @OshoSArAF, I'm glad you found a solution to your problem. Please consider [answering your own question](https://meta.stackexchange.com/questions/17463/can-i-answer-my-own-questions-even-if-i-knew-the-answer-before-asking) and then accepting it if you feel it is the best solution. – ChrisGPT was on strike Jul 19 '16 at 20:07

1 Answers1

0

Load your resources using a // protocol instead of http:// or https://. That will cause the browser to request resources using a protocol that matches the page (using SSL if the page does, and not if it doesn't).

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257