0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-17 16:55:12 +00:00

fix issues with external URL handling

This commit is contained in:
barath 2022-06-19 12:43:49 +05:30
parent b70150dc96
commit 6c506ba8d4
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -63,7 +63,7 @@ function linkParser(url) {
if (url) { if (url) {
try { try {
const slug = new URL(setHttp(url)); 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") { if (host == "youtube.com") {
result = slug; result = slug;
} else if (host == "youtu.be") { } else if (host == "youtu.be") {