1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2026-02-07 07:42:59 +00:00

Implemented routing to be more compatible for extension popup

This commit is contained in:
2025-02-28 03:18:18 +04:00
parent 92854f4d6b
commit f687389516
3 changed files with 64 additions and 3 deletions

View File

@@ -1,8 +1,13 @@
/** @type {import('@sveltejs/kit').Reroute} */
export function reroute({url}) {
import type { Reroute } from "@sveltejs/kit";
export const reroute: Reroute = ({url}) => {
// Reroute index.html as just / for the root.
// Browser extension starts from with the index.html file in the pathname which is not correct for the router.
if (url.pathname === '/index.html') {
if (url.searchParams.has('path')) {
return url.searchParams.get('path')!;
}
return "/";
}
}
};