The initialization code:
FB.init({
appId: \'123456789012345\',
channelUrl: \'http://localhost/Some/Url/FacebookCh
Not an easy one... but it could work:
First, to force closing the dialog you must pay attention to the response: See the entire documentation and example here: https://developers.facebook.com/docs/reference/javascript/FB.ui/
Once you have the response you should close the dialog: See: http://facebook.stackoverflow.com/questions/4646441/how-to-close-a-facebook-sdk-dialog-opened-with-fb-ui
Hope that helps! :)