From 191cbb55604682108cb8edc389a15142f3fecb44 Mon Sep 17 00:00:00 2001 From: SethBurkart123 Date: Thu, 21 Mar 2024 22:23:11 +1100 Subject: [PATCH] update firefox support --- firefox/manifest.json | 37 ------------------------------------- manifest.firefox.json | 32 ++++++++++++++++++++++++++++++++ src/SEQTA.ts-loader.js | 22 ++++++++++++++++++++++ vite.config.ts | 1 + 4 files changed, 55 insertions(+), 37 deletions(-) delete mode 100644 firefox/manifest.json create mode 100644 manifest.firefox.json create mode 100644 src/SEQTA.ts-loader.js diff --git a/firefox/manifest.json b/firefox/manifest.json deleted file mode 100644 index e9633ce1..00000000 --- a/firefox/manifest.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "manifest_version": 2, - "name": "BetterSEQTA+", - "version": "3.2.2", - "description": "Make SEQTA usable and beautiful! A fork of BetterSEQTA to continue development and add WAY more features!!!", - "icons": { - "32": "../src/resources/icons/icon-32.png", - "48": "../src/resources/icons/icon-48.png", - "64": "../src/resources/icons/icon-64.png" - }, - "browser_action": { - "browser_style": true, - "default_popup": "../src/interface/index.html#settings", - "default_icon": { - "32": "../src/resources/icons/icon-32.png", - "48": "../src/resources/icons/icon-48.png", - "64": "../src/resources/icons/icon-64.png" - } - }, - "permissions": ["tabs", "notifications", "storage", "https://newsapi.org/"], - "background": { - "scripts": [ - "../src/background.ts" - ] - }, - "content_scripts": [ - { - "matches": ["*://*/*"], - "js": ["../src/SEQTA.ts"], - "run_at": "document_start" - } - ], - "web_accessible_resources": [ - "../src/*", - "../public/*" - ] -} \ No newline at end of file diff --git a/manifest.firefox.json b/manifest.firefox.json new file mode 100644 index 00000000..a644154f --- /dev/null +++ b/manifest.firefox.json @@ -0,0 +1,32 @@ +{ + "manifest_version": 3, + "name": "BetterSEQTA+", + "version": "3.2.2", + "description": "Make SEQTA usable and beautiful! A fork of BetterSEQTA to continue development and add WAY more features!!!", + "icons": { + "32": "src/resources/icons/icon-32.png", + "48": "src/resources/icons/icon-48.png", + "64": "src/resources/icons/icon-64.png" + }, + "action": { + "browser_style": true, + "default_popup": "src/interface/index.html#settings", + "default_icon": { + "32": "src/resources/icons/icon-32.png", + "48": "src/resources/icons/icon-48.png", + "64": "src/resources/icons/icon-64.png" + } + }, + "permissions": ["tabs", "notifications", "storage"], + "host_permissions": ["https://newsapi.org/", "*://*/*"], + "background": { + "scripts": ["src/background.ts"] + }, + "content_scripts": [ + { + "matches": ["*://*/*"], + "js": ["src/SEQTA.ts"], + "run_at": "document_start" + } + ] +} diff --git a/src/SEQTA.ts-loader.js b/src/SEQTA.ts-loader.js new file mode 100644 index 00000000..c0a5415d --- /dev/null +++ b/src/SEQTA.ts-loader.js @@ -0,0 +1,22 @@ +(function () { + 'use strict'; + + const injectTime = performance.now(); + (async () => { + if ("vendor/crx-client-preamble.js") + await import( + /* @vite-ignore */ + chrome.runtime.getURL("vendor/crx-client-preamble.js") + ); + await import( + /* @vite-ignore */ + chrome.runtime.getURL("vendor/vite-client.js") + ); + const { onExecute } = await import( + /* @vite-ignore */ + chrome.runtime.getURL("../src/SEQTA.ts.js") + ); + onExecute?.({ perf: { injectTime, loadTime: performance.now() - injectTime } }); + })().catch(console.error); + +})(); diff --git a/vite.config.ts b/vite.config.ts index 895cfae6..b2216711 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -21,4 +21,5 @@ export default defineConfig({ authToken: process.env.SENTRY_AUTH_TOKEN, }), ], + server: { port: 6000, hmr: { port: 6000 } } })