Open Facebook in browser

I created an app for Facebook that, in short, at a certain time it uploads a photo to the visitor's album, and then I use var janela = window.open({urldafoto}) to open that photo in the album. So far so good.

I needed to know when this window would be closed, and since onunload doesn't work for other domains, I made a script that uses setTimeout by checking the janela.closed Property.

On PC this app is working 100% as it should.

The problem is when I open it by the Android phone, because when I click the button to open the window, Android asks me if I want to open using the Facebook app (installed on the phone), and this hinders the janela.closed.

Is there any way to force Android to open the link in the browser itself in use?

If you have any other idea how to monitor if the window is closed, it would also be interesting to know.

Author: Randrade, 2016-03-11