Skip to content

Commit 46b8211

Browse files
committed
MOBILE-3401 iab: Fix override window.open in iOS
1 parent 2067459 commit 46b8211

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/providers/utils/utils.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,14 @@ export class CoreUtilsProvider {
8686
protected qrScanner: QRScanner) {
8787
this.logger = logger.getInstance('CoreUtilsProvider');
8888

89-
const win = <any> window;
89+
this.platform.ready().then(() => {
90+
const win = <any> window;
9091

91-
if (win.cordova && win.cordova.InAppBrowser) {
92-
// Override the default window.open with the InAppBrowser one.
93-
win.open = win.cordova.InAppBrowser.open;
94-
}
92+
if (win.cordova && win.cordova.InAppBrowser) {
93+
// Override the default window.open with the InAppBrowser one.
94+
win.open = win.cordova.InAppBrowser.open;
95+
}
96+
});
9597
}
9698

9799
/**

0 commit comments

Comments
 (0)