From 90e408a53ba3dc78cb3558c343170d338d8f1658 Mon Sep 17 00:00:00 2001 From: Jens Fredskov Date: Mon, 20 Oct 2025 15:33:49 +0200 Subject: [PATCH 1/2] Add Firefox support with manual installation instructions Updated manifest.json to support both Chrome and Firefox browsers by removing Chrome-specific schema and adding Firefox gecko settings. Added Firefox installation section to README with instructions for manual installation as a temporary add-on. --- README.md | 17 +++++++++++++++-- manifest.json | 9 +++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1ece64e..b593f81 100644 --- a/README.md +++ b/README.md @@ -25,17 +25,30 @@ A browser extension that brings syntax highlighting to file diffs in Azure DevOp ## Installation -### From the Chrome Web Store (Recommended) +### Chrome + +#### From the Chrome Web Store (Recommended) [Available in the Chrome Web Store](https://chromewebstore.google.com/detail/syntax-highlighter-for-az/lclohacjbfchomeeopaffkedfnbjicdn) -### Manual Installation +#### Manual Installation 1. Download or clone this repository. 2. Open Google Chrome and navigate to `chrome://extensions`. 3. Enable "Developer mode" in the top right corner. 4. Click "Load unpacked" and select the directory where you downloaded the repository. +### Firefox + +#### Manual Installation + +1. Download or clone this repository. +2. Open Firefox and navigate to `about:debugging#/runtime/this-firefox`. +3. Click "Load Temporary Add-on". +4. Navigate to the extension directory and select the `manifest.json` file. + +**Note:** The same `manifest.json` works for both Chrome and Firefox. For permanent installation in Firefox, the extension needs to be signed by Mozilla or installed as a temporary add-on (which resets on browser restart). + ## Usage Once installed, the extension will automatically apply syntax highlighting to files in any Azure DevOps pull request you view. There are no additional steps required. diff --git a/manifest.json b/manifest.json index 6537189..9a71eef 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,4 @@ { - "$schema": "https://json.schemastore.org/chrome-manifest", "manifest_version": 3, "name": "Syntax Highlighter for Azure DevOps", "version": "0.5.0", @@ -24,5 +23,11 @@ "css": ["prism/prism.css", "custom_styles.css"], "run_at": "document_idle" } - ] + ], + "browser_specific_settings": { + "gecko": { + "id": "ado-syntax-highlighter@ckob.github.io", + "strict_min_version": "109.0" + } + } } From 23729cb7efadb8fe5249d48dce753aa4c81aa87f Mon Sep 17 00:00:00 2001 From: Jens Fredskov Date: Tue, 21 Oct 2025 11:31:28 +0200 Subject: [PATCH 2/2] Add Firefox Manifest V3 background script compatibility --- background.js | 6 +++++- manifest.json | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index 66f6414..ab46faa 100644 --- a/background.js +++ b/background.js @@ -1,4 +1,8 @@ -importScripts('browser-polyfill.min.js'); +// Load browser polyfill for Chrome service worker +// Firefox will load this via the scripts array in manifest.json +if (typeof importScripts !== 'undefined') { + importScripts('browser-polyfill.min.js'); +} function injectContent(tabId) { console.log(`ADO Syntax Highlighter: Injecting into custom host on tab ${tabId}`); diff --git a/manifest.json b/manifest.json index 60b4f9c..3527817 100644 --- a/manifest.json +++ b/manifest.json @@ -21,7 +21,8 @@ "*://*/*" ], "background": { - "service_worker": "background.js" + "service_worker": "background.js", + "scripts": ["browser-polyfill.min.js", "background.js"] }, "options_ui": { "page": "options.html",