Heroku Node.js sample facebook application not working in Google Chrome

Heroku app, I'm trying to work (code here): https://github.com/heroku/facebook-template-nodejs

A "unsafe Javascript attempt to access a frame with a URL" occurs when a page loads in chrome.

The login button allows you to go to facebook, but actually does not register you in the application and does not give the same errors.

Has anyone got this app to work in Chrome or can anyone advise how to fix it?

PS it works great on Mozilla.

+4
source share
1 answer

This is almost certainly a cross-power issue, as mentioned above. Generally speaking, you just need to add the correct header information in the response.

Access-Control-Allow-Origin: *

In Node, I think it’s just a matter of adding it as another header in the answer using

response.writeHead

See http://nodejs.org/api/http.html#http_response_writehead_statuscode_reasonphrase_headers

Oh, and there are explicit instructions on how to do this if you are using Express. I see no reason why it cannot work using a plain old node.

http://enable-cors.org/server_expressjs.html

So, I looked at your link, in your case, I think you just need to enter the header information before using any other express application methods.

As for why it works in Firefox, and not in Chrome, I’m not sure. Both support CORS in many versions. Perhaps you have a Chrome extension that is interfering.

0
source

All Articles