Harsh Choudhary
Harsh Choudhary

Reputation: 475

Facebook App is not working in Chrome but well in Firefox

I have just started making Facebook Apps using heroku. I made a test app. I uploaded a page on heroku which uses HTML5, CSS and Javascript. The app is not showing in Google Chrome https://apps.facebook.com/shrytestapp/ but works well in Mozilla Firefox. Also, the page works well when opened in heroku server http://salty-shelf-6707.herokuapp.com/.

Upvotes: 4

Views: 3181

Answers (1)

Adam Elsodaney
Adam Elsodaney

Reputation: 7818

When you access the app within Facebook, HTTPS is used to transfer the data, but Chrome has blocked content delivered over normal HTTP as a result and insists that everything be transfered securely whereas Firefox isn't so fussy.

Here's what the Console is showing in Chrome

[blocked] The page at https://salty-shelf-6707.herokuapp.com/
    ran insecure content from http://www.google.com/jsapi.
Uncaught ReferenceError: google is not defined

Google's JS API has been blocked and the JavaScript fails to run.

(You also have some not found errors, but that's unrelated)

The app works fine through the http://salty-shelf-6707.herokuapp.com/ as you mentioned, but not through https://salty-shelf-6707.herokuapp.com/

Try using the following instead to load the API

<script type="text/javascript" src="//www.google.com/jsapi"></script>

the // at the start of the src value will make the url protocol-relative or for the correct technical term, scheme-relative.

Paul Irish, the lead developer of HTML5 Boilerplate, has more information about this in a post on his site.

Upvotes: 5

Related Questions