Facebook gives “Unsafe JavaScript attempt to access frame with URL” error in Chrome

I’ve found the solution. If you execute FB.login without user action, webkit blocks the popups.

For instance, I used an invite system on my project. There was a input/text to enter invitation code. I checked the invitation code is available with an ajax/post request. if it is available, I run FB.login(). As you guess, browser blocked popup and tons of errors appeared at js console.

So you must run FB.login() after a user action. I’ll put a facebook login button between ajax/post and FB.login(). Users’ll have to click it -thats sucks- but they’ll not see a problem.

Btw, the problem reoccurs after a few days. I think it’s about trust system of browser. When you’re developing it, you visit lots of times, browser thinks it’s reliable at first. I’m not sure about this part but my solution works.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)