I'm opening a new window to complete an Instagram oauth like so:
var newWindow = window.open(url, 'Instagram Login', 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
where the url
is simply the oauth path for the given app. Upon authentication, the following code looks for a function that was defined on the application side to trigger a success callback:
if (window.opener && window.opener.foo) {
window.opener.foo("photo:social:login:success", gon.social_profile);
}
This works flawlessly on desktop as well as ios, but android chrome tells me window.opener
is null, meaning the callback is never reached.
The strange part is that trying the exact same flow on an incognito window in android chrome it works without any issue. window.opener
points to the original window, and the callback function is successfully fired.
I've already attempted using parent.window.opener
as well as top.window.opener
as the code which opens the popup window is inside of an iframe, but it seems to make no difference. is there any reason why android would act differently here?