skyman
skyman

Reputation: 229

Facebook API not work in Opera

The Facebook API doesn't work in Opera: FB.Canvas.setSize - not change a canvas size. FB.Canvas.getPageInfo - does not call callback function.

To reproduce: Open http://apps.facebook.com/operafbbug/ in Opera and, to compare, in Chrome (or Firefox, IE)

Expected Behavior:
The Canvas height will changed to 1100, excepting Opera When the FB.Canvas.getPageInfo function is called and returns data, this page will show alert 'info'. You will see this alert in all browsers, excepting Opera, again.

Bug in facebook bug tracker: http://developers.facebook.com/bugs/188820761219553

Upvotes: 0

Views: 1511

Answers (1)

hallvors
hallvors

Reputation: 6239

Quoting myself from the FB bug tracker: Opera fires an asynchronous load event for about:blank which results in the canvas_proxy IFRAME being prematurely removed. Opera starts running into this because of hiding document.attachEvent to avoid another, related problem caused by the IE branch of the script ( https://github.com/operasoftware/browserjs/issues/1 ).

As for workarounds, doing

document.attachEvent=function(){}

before embedding the Facebook script should work as a workaround, but is very ugly and probably won't keep working in the future. This needs to be fixed by Facebook (by ignoring the problematic load event and not remove the IFRAME until it knows the real target content loaded) or by Opera (by figuring out what race condition or timing gotcha makes Opera fire an unexpected load event even though the IFRAME is being navigated to some other URL).

Opera should probably add a temporary workaround to browser.js too. You should probably ignore this issue altogether and hold off testing with Opera until Opera and/or Facebook sorts it out.

Upvotes: 1

Related Questions