escaping
This commit is contained in:
parent
3de1221c20
commit
69652ba085
1 changed files with 8 additions and 1 deletions
|
|
@ -2300,7 +2300,14 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||
const url = query.startsWith('http') ? query : 'https://' + query;
|
||||
try {
|
||||
const urlObj = new URL(url);
|
||||
const path = urlObj.pathname;
|
||||
let path = urlObj.pathname;
|
||||
// Remove trailing slashes and get just endpoint/id
|
||||
path = path.replace(/\/+$/, '');
|
||||
// Get just the first two segments (e.g., /album/382839956)
|
||||
const segments = path.split('/').filter((s) => s);
|
||||
if (segments.length >= 2) {
|
||||
path = '/' + segments[0] + '/' + segments[1];
|
||||
}
|
||||
navigate(path);
|
||||
return true;
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Reference in a new issue