From 64fed8ef87872adf70826d58ed8088294aedc94d Mon Sep 17 00:00:00 2001 From: Bauke Date: Wed, 5 Oct 2022 13:09:52 +0200 Subject: [PATCH] Add logo, manifest and types files. --- source/assets/re-nav.png | Bin 0 -> 2011 bytes source/assets/re-nav.svg | 16 ++++++++++++++ source/manifest.ts | 45 +++++++++++++++++++++++++++++++++++++++ source/types.d.ts | 20 +++++++++++++++++ 4 files changed, 81 insertions(+) create mode 100644 source/assets/re-nav.png create mode 100644 source/assets/re-nav.svg create mode 100644 source/manifest.ts create mode 100644 source/types.d.ts diff --git a/source/assets/re-nav.png b/source/assets/re-nav.png new file mode 100644 index 0000000000000000000000000000000000000000..9dacba049601575dfd70463961cb23fc4e421bbe GIT binary patch literal 2011 zcmb7_`8U)L7so#{Xre@z$0KBU5DH^YV=P(6uIx+6l0ljxyUEzIWKG75Wy;smmkf^Gd~dHF|LXqlZbCN$u`t z_VB~deUby<&JdfpoToe?b^GUssUvZ);!x@VB8IxJQ@rnliS=2%IAY>dOIq z%>gwTKtuq0n%f|SQ}TaZXL7d#moM{ZcMtE*-TsnTR@6B}E*}phy9H|zh5}g(^=fpa z3(8i7JSBVI9+ce`$~z9#{`2BpkB*&%=ZLR#$B4N9$R;Du<8i*af`b8MyrTC@4EH*(`~OLnl!>ke}# zLM;O1;dfZ6(;uTUtJLpa(CW5&W<`0;s(p01NIS%vB60z_Wh{JMj_h9mUVhzJk5D}3iSIg8f=0OzpX zoqo}Wx%ME|c&$!RTVmWBoW1>r)vB$G8cyd}O2;(Q|Bi!puHdigU@VRe0ak}e@c-5Z9jYwz@ovV_jTdS4=^kwZ%Z4da9rd8qHP~fFcy{Ymqlv{PG z9hZm6txjkIhmQUP)rzczTTh|-$5!g&NMmoPKSI;20^U$b}D+~SDGkQ1e z5;+h&Us0BO#YS+M!}%v`kz*p+$>975S2$G1xh4xJ`Gc>iu(|54lF(Fx@8akBLS5q< zSGhnTjBJZxrqy29yZs3n|1x2UJS{W+pzBI{P(lGZ$*;0Zt*%gxLFx$Ch#8+kd|l@* zo4j>biqyfdW(&L7gM#%j)U}@#zy1T+UK@nRSWZ7mZ;FZ9vAekmO%DOfRPoU=KMbcN zhzFe#x|oTIG#i?MFKClIm0naY$XsHad)X!TZpXZO6zV4UG?#kbYcXfCO=t5^z^SGH zmE@_5@sfMPy`EW^rzbB-8y|zf_D&Pv@R&#`!Q*Pu5KSnPIV6{NeCvBk*NS()?bWqtHe z?V-2^xoM&emW{ptf}k%pZWMpNoO!aye}f=8Cg3pw3f+zg+pL;=pR%KHLA|Ai$S zeqm@t?|KERw@oNPq>NWAx88ep)sW@a_&U4HVa@!brWhvD9|Tnma6KtHHFx|=c4&m2!Ew8Bhw|})uC%w^12&PL&>o^WoL_kD z8;Dor46a{0*1?Kcm0m_3mu_{v66qf7L>O8LCQrrIiYpCA$=sGGEj2X^2N>72voYV%bFC8bv zgHt*WWu(QHU>KS(02W_T$BZTckxP=_CKofx|6&_n1QYuWP2JSbu#5Fj=77ek!Pn)) zW=mZxCWMwHk@SwD80kKS{mWNuB{UQPfJmiw4t=XU!nolNY@=_JKeoVH mtRFl~43hYN$@O13x5YOCYfk#e;@df + + + + ↩ + + diff --git a/source/manifest.ts b/source/manifest.ts new file mode 100644 index 0000000..5f123d1 --- /dev/null +++ b/source/manifest.ts @@ -0,0 +1,45 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +export default function createManifest( + target: string, +): Record { + const manifest: Record = { + name: 're-nav', + description: 'Navigation redirects for the masses.', + version: '0.1.0', + permissions: ['storage', 'webNavigation'], + options_ui: { + page: 'options/index.html', + open_in_tab: true, + }, + }; + + const icons = { + 128: 'assets/re-nav.png', + }; + + manifest.icons = icons; + + const browserAction = { + default_icon: icons, + }; + + const backgroundScript = 'background-scripts/initialize.ts'; + + if (target === 'chromium') { + manifest.manifest_version = 3; + manifest.action = browserAction; + manifest.background = { + service_worker: backgroundScript, + type: 'module', + }; + } else { + manifest.manifest_version = 2; + manifest.browser_action = browserAction; + manifest.background = { + scripts: [backgroundScript], + }; + } + + return manifest; +} diff --git a/source/types.d.ts b/source/types.d.ts new file mode 100644 index 0000000..17d41e9 --- /dev/null +++ b/source/types.d.ts @@ -0,0 +1,20 @@ +import {html} from 'htm/preact'; + +declare global { + // See Vite documentation for `import.meta.env` usage. + // https://vitejs.dev/guide/env-and-mode.html + + interface ImportMeta { + readonly env: ImportMetaEnv; + } + + interface ImportMetaEnv { + readonly BASE_URL: string; + readonly DEV: boolean; + readonly MODE: string; + readonly PROD: boolean; + readonly VITE_BROWSER: 'chromium' | 'firefox'; + } + + type HtmComponent = ReturnType; +}