From 65c7a12a7a353d57d36777233927266d6684d373 Mon Sep 17 00:00:00 2001 From: Darren Anderson Date: Sun, 18 Feb 2024 18:04:52 +0000 Subject: [PATCH] Add firefox support. --- README.md | 4 ++-- htlogo.png | Bin 2886 -> 0 bytes htlogosq.png | Bin 0 -> 3835 bytes manifest.json | 2 +- service/background.js | 11 +++++++++-- 5 files changed, 12 insertions(+), 5 deletions(-) delete mode 100644 htlogo.png create mode 100644 htlogosq.png diff --git a/README.md b/README.md index 0a3eac5..546608d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/darrena092) ## Overview -HeaderTools is a versatile and user-friendly extension designed to provide users the capability to manipulate and inject request headers based on regex domain selectors. +HeaderTools is a versatile and user-friendly browser extension supporting Chrome, Brave and Firefox designed to provide users the capability to manipulate and inject request headers based on regex domain selectors. This was largely created as a replacement for ModHeader due to the author's decision to include Adware in a recent update. @@ -21,7 +21,7 @@ This was largely created as a replacement for ModHeader due to the author's deci * User-friendly Interface: The interface is designed to be intuitive and user-friendly, simplifying the process of creating and managing your rules. ## How to Use -* Install the Extension: Add HeaderTools to your Chrome/Brave browser using the latest release from the releases page. +* Install the Extension: Add HeaderTools to your Chrome/Brave browser using the latest release from the releases page (Firefox release pending review). * Open the Extension: Click on the HeaderTools icon in your browser's toolbar. * Create a Rule: * Click on the "New Rule" button to start creating a rule. diff --git a/htlogo.png b/htlogo.png deleted file mode 100644 index 8034b30632cecc340efe98d058f08f6c3aee2751..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2886 zcmV-M3%T@(P)d(yR&;fKaXLs{`+T6mjCXFcR{eATnk^dB6=-M?o>WvV zCp;rOw~`eUP$S+osT3T3M zPJcR;SE~0hUt*7CmKG)UiT9urz>gOvvrOS*jA15Z9>dKDL$abyzNehOKvr@UnNorf!zi7A^%<@* zwfyW6jDLt;tZDs+;MjtT>zWqXgUfB`ep16)xGY)4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#0+z;JiSAx2~SRiT%65 z3)Wv1n@Xr4=6P`Al!4cKx`U4ygxW)}ecjb`r2~I-sw(t(FDHrArNGMs{ZHeAr7Jh$ z?D%`&{?|+##~;>wdEg7DJ4?uFkOI>(D-6^fh8;D~HDDFCD2l(;3+ev?MwJw~00)lM zQs3E4(BJCbWA))Cqyu$_#anA?On}Qs*OP`q;d!4dIh1=O($bS4FS%H-K?cBO8>KbE`nCy)UxCuFZQw4~Wx>#^^8A4kPxrK{g7(05BoBJ~&`y(CkvR0O4L zZ5ix1_ENXYFaO)CT{{UVtH7&0F{|uV+!rcb`wn1ZG^xaxbhEg<$3!{| zzPy#6L~0|jAly`9%<$^i9gkKSsMr1%pXKe-uK*^8n@&vWF6E1uY6v#tGbB>aAdb+M ziHF!YQiy$kDaJDhrHKbfq&5NbN>9Z%UAXqJ!p#i%D81^HYkv~>b?K=XWD-ufGuOTa z*c{4O1}TJB=gzg~0>24uJVT^}Tj0>O=OB*0FlbKrB~4xXX2cN~291fPh_P$mgg6z! zpefOnEqCpY0&ZmE8%iSDg9=>xBZz|e2F-~6XcE`{Frsk2K_lcGM&#Nvfj>!!W$=Z} zBSvQeJ0-?5{oyt%^AMucp{~q8q)v1&_dWnaO{PzO?RGmsWqn~&H*X~Bl{JpAE zDOdCq4;lGW5T#ZPA)~K&$jHAEf8U%j6oKC2AtV1?z<*SyQcmbE9?qWm`&6e=F2qAT kfNOUmX8sGRQz-}j4^({vf<)Wo3;+NC07*qoM6N<$f((UxZ2$lO diff --git a/htlogosq.png b/htlogosq.png new file mode 100644 index 0000000000000000000000000000000000000000..dd9accd7bc66ce41ce0c44384edd17b0dce7cfa1 GIT binary patch literal 3835 zcmbVP2UJt(wmylpPz{JiPzVVD3lI`Qi-cn67_cBPh(bt#P?C@Y2t6PQjH4h$83h3q zaa77E76eHmUZu=9h&1U64h)KL8D;a2*ODyhgE|}KgwPt znZsistxa&oG*eSN($d<5X=YAfFlk0eyeZxci^E|}t&MSbBEgi1w?uxqP@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+yEczJ0U7~maz_x3t3URFGhB=858^kBMJ*cr(4@y4jnD})4VeM%!fBYJx2g<7Y%pVE6t`3!eY)ZY3q9$ zb^SIaZ^Jkz(1t-eOs&z_UHzYKkFT>+vCLOT9fnb+$H;mob|3zr6O<$@%U8f%PxtA) z$?frkw(i&(?xno5O!H$Ua%W7agCkFa|v%?NuracCtn+FmiO&e>f?*VUKFf zW(OoRk5p{t!3X~QXVo%mq$hQbk(ocz`l#;DNXZq+do#z~HPO(+2?jIg?LQFG-Di%W z4kyU*Jk-g`3KiZr!iT>dIQOX3`laTHn5jcK_1*}A!2l0rijt^AE0g!7i>c}1Dav(G zsSf0eFYu3V+kHDAk(6$J7OC~R??9@Zlf?x+?8PBs%#IrLE1ZgTrVr5bPWB42?YuSt z`TpliC#E>dDM)1W{G`V#8Er*^6Re z#BD}r#12$9f29W$S!=vKxYd0-To(ca)GJwQG+YI>rRu0w3P" diff --git a/service/background.js b/service/background.js index 39aa9a5..a1ccbdc 100644 --- a/service/background.js +++ b/service/background.js @@ -1,4 +1,4 @@ -// Preload rules, as the extension API doesn't support blocking operations. +// Preload rules, as the Chrome extension API doesn't support blocking operations. let cachedRules = []; function updateCachedRules() { @@ -17,6 +17,13 @@ chrome.storage.onChanged.addListener((changes, namespace) => { } }); +// Cross browser support +const extraInfoSpec = ["blocking", "requestHeaders"]; +if (typeof browser === "undefined") { + // Detect Chrome and add extraHeaders. + extraInfoSpec.push("extraHeaders"); +} + chrome.webRequest.onBeforeSendHeaders.addListener( (details) => { cachedRules.forEach(rule => { @@ -35,5 +42,5 @@ chrome.webRequest.onBeforeSendHeaders.addListener( return { requestHeaders: details.requestHeaders }; }, { urls: [""] }, - ["blocking", "requestHeaders", "extraHeaders"] + extraInfoSpec ); \ No newline at end of file