Our app allows users to login through Facebook. The page creates a popup which is redirected to FB login page (https://lm.facebook.com/l.php?u=https%3A%2F%2Fm.facebook.com%2Fdialog%2Fconsent%2Fcomplete% ..., with header Cross-Origin-Opener-Policy: same-origin-allow-popups;report-to="coop_report". At this point the window.opener reference is valid and points to original window. On desktop and iPhone the login then completes, redirects back to our page, with window.opener reference still valid.
However on Android (Chrome) when the popup redirects to our page it does so with window.opener set to null.
Meantime the only redirects are:
https://m.facebook.com/dialog/consent/complete/ with Cross-Origin-Opener-Policy: unsafe-none;report-to="coop_report" header
and then back to our page without any COOP header.
There is one apperent difference - on Android a dialogue is shown that is not triggered on iPhone or desktop: "You previously logged in to ****** identity with Facebook. Would you like to continue?" On this dialogue the window still has the opener reference, and after it the above mentioned requests are fired.
I am not sure where exactly was the opener reference lost, or how can I prevent that, and why does it only happen with Android login process. I have found nothing in the Facebook documentation so far, and it seems to me that this could be a bug rather than a feature - however I still need to overcome it somehow.
Cross-Origin-Opener-Policyhas no support in Opera on Android yet. (And not in Android Webviews either, but I'm guessing you are not using those here?)Fb.login()method?https://lm.facebook.com/l.phpis Facebook's own "link shim" - its purpose is to redirect elsewhere, usually used by Facebook itself, for external links. And why the redirection target then ishttps://m.facebook.com/dialog/consent/complete/, I also don't understand - [...]https://www.facebook.com/vXX.Y/dialog/oauth. I'm guessing Facebook realize that we are not in a "/dialog/consent/complete/ state" here, and automatically redirect to the actual login dialog URL ... but it really doesn't make much sense to have so many redirects involved to begin with.