From dc100b5d3ac1db5f1dc011ea2536c286f56fa55b Mon Sep 17 00:00:00 2001 From: Lukas Zenick Date: Fri, 8 Mar 2024 20:58:52 -0600 Subject: [PATCH] fix: options page (#131) * fix: options page * chore: rename title of options page --------- Co-authored-by: Razboy20 --- options.html | 1 + src/manifest.ts | 2 +- src/pages/options/index.html | 2 +- src/views/components/PopupMain.tsx | 2 +- vite.config.ts | 5 +++++ 5 files changed, 9 insertions(+), 3 deletions(-) create mode 120000 options.html diff --git a/options.html b/options.html new file mode 120000 index 00000000..7fd39b9e --- /dev/null +++ b/options.html @@ -0,0 +1 @@ +src/pages/options/index.html \ No newline at end of file diff --git a/src/manifest.ts b/src/manifest.ts index 8efde8fa..3d3cd6bd 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -25,7 +25,7 @@ const manifest = defineManifest(async () => ({ name: `${packageJson.displayName ?? packageJson.name}${mode === 'development' ? ' (dev)' : ''}`, version: `${major}.${minor}.${patch}.${label}`, description: packageJson.description, - options_page: 'src/pages/options/index.html', + options_page: 'options.html', background: { service_worker: 'src/pages/background/background.ts' }, permissions: ['storage', 'unlimitedStorage', 'background', 'scripting'], host_permissions: process.env.MODE === 'development' ? [...HOST_PERMISSIONS, ''] : HOST_PERMISSIONS, diff --git a/src/pages/options/index.html b/src/pages/options/index.html index b4b032c8..2e290500 100644 --- a/src/pages/options/index.html +++ b/src/pages/options/index.html @@ -4,7 +4,7 @@ - Popup + UTRP Options diff --git a/src/views/components/PopupMain.tsx b/src/views/components/PopupMain.tsx index fed74259..1c419a6b 100644 --- a/src/views/components/PopupMain.tsx +++ b/src/views/components/PopupMain.tsx @@ -57,7 +57,7 @@ export default function PopupMain(): JSX.Element { )); const handleOpenOptions = async () => { - const url = chrome.runtime.getURL('/src/pages/options/index.html'); + const url = chrome.runtime.getURL('/options.html'); await openTabFromContentScript(url); }; diff --git a/vite.config.ts b/vite.config.ts index a2d65bfa..39ac8f97 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -136,6 +136,10 @@ export default defineConfig({ target: 'http://localhost:5173', rewrite: path => path.replace('calendar', 'src/pages/calendar/index'), }, + '/options.html': { + target: 'http://localhost:5173', + rewrite: path => path.replace('options', 'src/pages/options/index'), + }, }, }, build: { @@ -143,6 +147,7 @@ export default defineConfig({ input: { debug: 'src/pages/debug/index.html', calendar: 'src/pages/calendar/index.html', + options: 'src/pages/options/index.html', }, // output: { // entryFileNames: `[name].js`, // otherwise it will add the hash