Merge pull request #2904 from dpalou/MOBILE-3715

MOBILE-3715 iab: Fix load previous page after open external app
main
Pau Ferrer Ocaña 2021-07-29 11:17:53 +02:00 committed by GitHub
commit 3c176311b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -110,6 +110,7 @@ export class AppComponent implements OnInit, AfterViewInit {
// Check URLs loaded in any InAppBrowser.
CoreEvents.on(CoreEvents.IAB_LOAD_START, (event) => {
// URLs with a custom scheme can be prefixed with "http://" or "https://", we need to remove this.
const protocol = CoreUrlUtils.getUrlProtocol(event.url);
const url = event.url.replace(/^https?:\/\//, '');
if (CoreCustomURLSchemes.isCustomURL(url)) {
@ -135,7 +136,7 @@ export class AppComponent implements OnInit, AfterViewInit {
CoreUtils.closeInAppBrowser();
}
} else {
this.lastInAppUrl = url;
this.lastInAppUrl = protocol ? `${protocol}://${url}` : url;
}
}
});