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:
parent
b70150dc96
commit
6c506ba8d4
2 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -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") {
|
||||||
|
|
Loading…
Reference in a new issue