Javascript – Facebook app iframe + JS Facebook.init + IE7 + Flash9 sandbox error

facebookflashjavascript

During facebook iframe application integration I ask for publish permissions – I have HTML which loads JS Connect library and asks for permission dialog..


  FB_RequireFeatures(["XFBML"], function(){ 
        FB.Facebook.init("_MY_API_KEY", "MY_PATH/xd_receiver.htm");
        FB.Connect.showPermissionDialog('publish_stream');

However in IETester with IE7 i get weird errors

SecurityError: Error #2060: Security sandbox violation: ExternalInterface caller http://b.static.ak.fbcdn.net/rsrc.php/zDVWA/hash/bqv7w2jc.swf cannot access ..(MY APP PAGE)

    at flash.external::ExternalInterface$/_initJS()
    at flash.external::ExternalInterface$/addCallback()
    at flashutils::PostMessage()
    at XdComm()

As far as i understand xd file is intended for flash proxy that uses this ExternalInterface to communicate with facebook and show dialog. After i click OK, everything seems to work further.

Can anyone clarify what can cause this?

Best Answer

IETester isn't perfect, simply because it cannot fully emulate a proper IE environment. When things get tricky, it starts to give weird errors. And there isn't much trickier than a cross-domain Facebook iframe application.

I would find a real installation of IE7 and check if the problem exists there. If it doesn't, it's probably not worth your time. Microsoft provides a Virtual PC application that is excellent for this kind of thing, as well as many XP and Vista test images containing various versions of IE. They are large downloads, but I highly recommend them over IETester.