Skip to content

Commit b117cb5

Browse files
committed
Merge branch 'cordova_pr' into dev
2 parents 63397c8 + 5851ec8 commit b117cb5

5 files changed

Lines changed: 53 additions & 59 deletions

File tree

‎dist/oidc-client.js‎

Lines changed: 19 additions & 21 deletions
Large diffs are not rendered by default.

‎dist/oidc-client.min.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/oidc-client.js‎

Lines changed: 19 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/oidc-client.min.js‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/CordovaPopupWindow.js‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ export default class CordovaPopupWindow {
1616
this._reject = reject;
1717
});
1818

19-
if (!window.cordova) {
20-
return _promise.reject("cordova is undefined")
21-
}
22-
23-
var cordovaMetadata = window.cordova.require("cordova/plugin_list").metadata;
24-
if (this._isInAppBrowserInstalled(cordovaMetadata) === false) {
25-
return _promise.reject("InAppBrowser plugin not found")
26-
}
27-
2819
this.features = params.popupWindowFeatures || DefaultPopupFeatures;
2920
this.target = params.popupWindowTarget || DefaultPopupTarget;
3021

@@ -33,7 +24,7 @@ export default class CordovaPopupWindow {
3324
}
3425

3526
_isInAppBrowserInstalled(cordovaMetadata) {
36-
return ["cordova-plugin-inappbrowser", "org.apache.cordova.inappbrowser"].some(function (name) {
27+
return ["cordova-plugin-inappbrowser", "cordova-plugin-inappbrowser.inappbrowser", "org.apache.cordova.inappbrowser"].some(function (name) {
3728
return cordovaMetadata.hasOwnProperty(name)
3829
})
3930
}
@@ -44,6 +35,14 @@ export default class CordovaPopupWindow {
4435
if (!params || !params.url) {
4536
this._error("No url provided");
4637
} else {
38+
if (!window.cordova) {
39+
return this._error("cordova is undefined")
40+
}
41+
42+
var cordovaMetadata = window.cordova.require("cordova/plugin_list").metadata;
43+
if (this._isInAppBrowserInstalled(cordovaMetadata) === false) {
44+
return this._error("InAppBrowser plugin not found")
45+
}
4746
this._popup = cordova.InAppBrowser.open(params.url, this.target, this.features);
4847
if (this._popup) {
4948
Log.info("popup successfully created");
@@ -89,10 +88,9 @@ export default class CordovaPopupWindow {
8988
_cleanup() {
9089
Log.info("CordovaPopupWindow._cleanup");
9190

92-
this._popup.removeEventListener("exit", this._exitCallbackEvent, false);
93-
this._popup.removeEventListener("loadstart", this._loadStartCallbackEvent, false);
94-
9591
if (this._popup){
92+
this._popup.removeEventListener("exit", this._exitCallbackEvent, false);
93+
this._popup.removeEventListener("loadstart", this._loadStartCallbackEvent, false);
9694
this._popup.close();
9795
}
9896
this._popup = null;

0 commit comments

Comments
 (0)