Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook authentication opening tab instead of popup in Chrome 59

the problem I'm facing is pretty much as the title describes it. I'm using Facebook auth (using the JavaScript SDK) so users can login to my app and it was working ok with Chrome UNTIL Chrome version 59 (the latest one).

Before Chrome 59 (58, 57, ...) when the user tries to login, the Facebook popup opens and the request for the Facebook credentials is made. But, in Chrome 59 instead of a popup, a new tab is opened. The problem is that this tab isn't in focus and the user don't see that it was opened, or sometimes it is opened and is infinitely loading.

Is someone else facing this problem? If so, are there any workarounds?

Thanks!

SOLVED

As commented by Raul Mangolin, this issue was already solved by Faceebook.

like image 383
Bruno Silvano Avatar asked Jun 07 '17 16:06

Bruno Silvano


2 Answers

Chrome 59 seems to handle location=yes in window.open now differently. I assume this is a bug, because Chrome shows the location bar anyway and I can't find a change log entry about this.

So if you have any influence on how the popup is opened, then change it to location=no as a workaround for now.

// Opens as new tab in Chrome 59
// Older versions and all other browsers open it as popup
window.open("https://www.facebook.com","","location=yes")

// Opens as popup also in Chrome 59
// Chrome, Firefox and Edge show location bar regardless; IE shows URL in title
window.open("https://www.facebook.com","","location=no")

Test it yourself: http://output.jsbin.com/hikeleyiwe

As Raul Mangolin pointed out, Facebook is aware of this issue: https://developers.facebook.com/bugs/470345923308265/

like image 74
djk Avatar answered Oct 26 '22 18:10

djk


In Chrome 59 it will open new tab instead of a popup window if the "location" or the "toolbar" is set to "yes".

Just set them to "no", like this:

"location=no, toolbar=no"

There's also a simpler solution - just don't include these statements at all and then popup will open instead of a new tab.

like image 25
Dominik Serafin Avatar answered Oct 26 '22 18:10

Dominik Serafin