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 8034b30..0000000 Binary files a/htlogo.png and /dev/null differ diff --git a/htlogosq.png b/htlogosq.png new file mode 100644 index 0000000..dd9accd Binary files /dev/null and b/htlogosq.png differ diff --git a/manifest.json b/manifest.json index 764ae8a..d83ac74 100644 --- a/manifest.json +++ b/manifest.json @@ -5,7 +5,7 @@ "version": "1.0", "browser_action": { "default_popup": "build/index.html", - "default_icon": "htlogo.png" + "default_icon": "htlogosq.png" }, "permissions": [ "webRequest", "webRequestBlocking", "storage", "" 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