Merge pull request #358 from barath-k/main

fix issues with external URL handling
This commit is contained in:
Alex 2022-06-19 19:24:49 +12:00 committed by GitHub
commit bfc6a9e9b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ export default {
CapacitorApp.addListener("appUrlOpen", (event) => {
this.$logger("ExternalURL", event.url);
// We only push to the route if there is a url present
linkParser(event.url);
const result = linkParser(event.url);
if (result) this.$router.push(result.pathname + result.search);
});

View File

@ -63,7 +63,7 @@ function linkParser(url) {
if (url) {
try {
const slug = new URL(setHttp(url));
const host = slug.hostname.toLowerCase().replace(/^www\./, "");
const host = slug.hostname.toLowerCase().replace(/^(www|m)\./, "");
if (host == "youtube.com") {
result = slug;
} else if (host == "youtu.be") {