window.opener.functionName() not working in app browser

We have a website which is integrated with a mobile app. The website is opened in the inAppBrowser of the app.

Now, in some page of a website one window opens another child window. After the child window complete its job, a javascript method is called of the parent window by using the code window.opener.functionName(). Now, the call to parent function is successfully executed from child window call in desktop or mobile browser, but the same is not able to call the parent function from child window.

I am thinking of performing a feature detection for mobile apps using the code:

if( window.cordova ) {
    inAppBrowser solution ;
} else {
    window.opener.functionName();
}

But I am not sure what will be the cordova solution for this.


Source: stackoverflow-javascript