This cant be done. It is browser security.
Scripts cannot close a window if it was not opened by the script.
Simply putting window.close does not work anymore as the Browser Vendors dont allow this anymore due to security reasons.
So in essence app developers are screwed and cannot return to app unless......
the window opened does NOT open a target other than _self and the script that opened the window is still active to close the window, which normally is not the case because you would not normally run a scriptt to open a window just to shut it again.
So I payed with the html component as I have have my app controls wrapped around the inappbrowser. This solution works perfectly, except when the browser session opens another window as _blank. When this happens, the browser breaks out of the app never to return.
As long as the target is _self all is good.