I want to programmatically close my InAppBrowser when it is redirecting to a certain page.
this.ref = this.iab.create(newPath, '_blank');
this.ref.on("loadstart").subscribe((event: InAppBrowserEvent) => {
this.ref.close();
});
This code works most of the times, but sometimes the event does not fire - and my InAppBrowser will be fully redirected to the completion page but the app fails to detect that. I also noticed, when this happens, event will be fired later, when I manually close the InAppBrowser. It feels like all the events are jammed somewhere when the InAppBrowser is showing in front. Is it possible that the codes in app.component.ts is somehow suspended when an InAppBrowser is showing?
Cordova CLI: 6.5.0
Ionic Framework Version: 3.3.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.3.7
ios-deploy version: 1.9.1
ios-sim version: 6.0.0
OS: macOS Sierra
Node Version: v7.6.0
Xcode version: Xcode 8.3.3 Build version 8E3004b
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"