I have an facebook canvas app that loads in an iframe on facebook, and I want to be able to focus the facebook tab in the browser from my code.
My app shows native browser notifications through the browser's Notification API (not facebook notifications), and I would like to focus the Facebook tab (within which my app loaded) when the user clicks the browser notification that my app shows.
If my app is loaded outside of facebook in a tab by itself (not in an iframe), then I can just use window.focus()
to refocus the tab; hoever, when loaded in facebook, because of the iframe, window.focus()
doesn't focus the tab, and because of cross-site origin, I don't think I can access the parent facebook window context to give it focus.
What solutions or workarounds might there be? I didn't find any functionality exposed by facebook api (eg. something like FB.Canvas.focus()
)