Customising FB.ui iframe dialog dimensions

I was faced with making some FB.ui dialogs fit neatly inside and iframe today.
The FB.ui dialogs get their default dimensions, from one of the methods in FB.UIServer.Methods

For example, if you’re usinge FB.ui({method:'stream.share'})
The dialog gets its size from FB.UIServer.Methods.stream.share.size
Which is equal to {height:380, width:575} if you take a look at it in a javascript console.

So these dimensions are there to be changed if you need to.

Note, I was using the ‘feed’ dialog which is not present in FB.UIServer.Methods so I defined it after my call to FB.init so it would be available when I opened by dialog…


FB.init({appId: '[my app id]', status: true, cookie: true, xfbml: true});
FB.UIServer.Methods["feed"] = {size:{width:500,height:240}};