mirror of
https://github.com/VueTubeApp/VueTube
synced 2024-11-29 06:33:05 +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) => {
|
||||
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);
|
||||
});
|
||||
|
||||
|
|
|
@ -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") {
|
||||
|
|
Loading…
Reference in a new issue