The following example shows how to create a simple Facebook login button with Facebook javascript API:

Normally, this page would be reloaded if user finished authorized your app. But it won’t be reloaded in Chrome due to the follwing error:

Unsafe JavaScript attempt to access frame with URL https://s-static.ak.fbcdn.net/connect/xd_proxy.php?version=3#cb=f363e58d9&origin=http%3A%2F%2Fwww.ab.com%2Ffcb27588&relation=opener&transport=postmessage&frame=fac4c0f18&access_token=AAAEHZBpoK3B0BALv8Cf96gaKEnn4ZBtXgjCOQCFFhVDL4K0rZAE2NGDcqZCPlZByNNKEDmYSGKHQv8jAUM2yGZCHkOcyXUKhoZD&expires_in=0&signed_request=g7sYd_XQx-EBPtQQGk-0ISRMrUDnT4L4WHAmlNsVFBU.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiJBUURKYkZBNjZuemduSDBBN0dXWmd2SGxZZkQxQVp4Qm1MSnc0Z3ppUV9FQ25VeEYyZmcyTmJGcFh3UHZDeWhyYnFrT1RxNmRVc2xsb0d4dlFCd290UjRyV0ZsSnJtVjFoNy1QUTlJbTRROXh3MmNKMGU1b0NReWtmT1ZZcXhMUDRVRldVSDgwVU5ic1BLTHdyNk80cFlSVVItQzNIYjhyRWgxek40ZFEzSkpreXhBcU1KSHljcWxETzh2dF96T3ZpN0EiLCJpc3N1ZWRfYXQiOjEzMzExMzg3MjQsInVzZXJfaWQiOiIxMTI5MjgzNDM3In0 from frame with URL http://www.ab.com/login.html. Domains, protocols and ports must match.

Some people use FB.getLoginStatus() to check if user authorized app at page loaded. If page could be reloaded, it’s no problem. However, in this case, it’s not. 

There are several questions on StackOverflow related to this:

http://stackoverflow.com/questions/3577947/facebook-gives-unsafe-javascript-attempt-to-access-frame-with-url-error-in-chr

http://stackoverflow.com/questions/8013008/facebook-authentication-unsafe-javascript-attempt-to-access-frame-with-url

http://stackoverflow.com/questions/3010170/unsafe-javascript-attempt-to-access-frame-with-url-error-being-continuously

But none of these solves my problem. I don’t want to solve this with introduce PHP sdk. I would like to solve it with pure front end codes. 

Therefore, I find 3 solutions:

  1. Ignore the error and register login event to solve the problem:
  2. Add attribute “show-faces="true”“ to <fb:login-button> to solve
  3. Add attribute "render-in-iframe="true”“ to <fb:login-button> to solve. This is a bad idea since this is an undocumented attribute.

In solution 2 and 3, login-button seems to be placed into an iframe. And 3 would display an incomplete login button (bug?)

    Img_2553
    Img_2551

    這家離上次去的屯京不遠, 但卻不像屯京一樣大排長龍, 其實店內還坐不到一半, 不過上次吃屯京是吃沾麵, 所以無法比較拉麵, 不過這家山小屋也是蠻好吃的

    我點的是 黑魔拉麵 , 跟我上次去大阪吃的黑河童是同類型的, 豚骨湯頭加上黑麻油, 一整碗像墨汁一樣, 豚骨湯頭還蠻鮮甜的, 應該有用心到, 配上黑麻油的香氣, 這碗湯頭是挺不錯的, 麵是細麵, 我要求要略硬, 口感還不錯, 叉燒則是一般

    餃子皮有煎脆, 內餡有燙口, 蠻好吃的

    最後….好久沒拍的空碗照:

    Img_2557

    Media_httpdistilleryi_htohh

    Taken at 挪威森林

    今天又跑去吃拉麵

    因為想到說我還沒吃過大海的地獄拉麵, 就跑去吃了一碗, 大海吃過了好幾次, 竹北這家, 我是認為不是很穩定, 有時吃的湯頭太淡, 有時卻又非常濃厚, 不過這附近也沒好吃的拉麵就是了

    這碗地獄拉麵是在原先的湯頭上加上辣醬而成的, 本想說感覺沒太大特色, 但吃起來還頗搭的, 辣味襯托出原本湯頭的甜味…

    我最喜歡的吃法就是加點一碗蔥, 倒進去豪邁的吃…. 

    這家是衝著雜誌介紹去吃的, Friday Night, 單槍匹馬去, 居然還要排到快40分鐘, 比平常這時候在台北車站吃花月嵐排更久, 它座位還比較多

    雜誌上介紹的是魚豚拉麵, 不過吃過一些魚貝系的湯頭, 我對這種湯頭並不是特別喜歡, 又想吃つけ麵(沾麵), 所以就點了這碗辣的沾麵來吃…(也有不辣的湯頭)

    加麵是不加價的, 我又多花了70元加料, 端來就是這麼滿滿的一大碗, 份量還很夠

    麵條是捲曲狀的, 還蠻好吸收湯汁的, 只是過軟, 個人偏好硬一點的麵條, 起初沾個兩三下就入口, 感覺湯頭不夠濃, 加上沾麵的溫度比拉麵低一點, 也不覺有多辣, 鹹度是還蠻夠的, 後來把麵料浸入一段時間再撈起吃(等於當拉麵來吃了), 就覺得還不錯了

    除了排隊久了點外, 這家還算不錯吃, 下次有機會再去試它的拉麵好了…