Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,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.
Expand Down
6 changes: 5 additions & 1 deletion background.js
Original file line number Diff line number Diff line change
@@ -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}`);
Expand Down
12 changes: 9 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"$schema": "https://json.schemastore.org/chrome-manifest",
"manifest_version": 3,
"name": "Syntax Highlighter for Azure DevOps",
"version": "0.6.0",
Expand All @@ -22,7 +21,8 @@
"*://*/*"
],
"background": {
"service_worker": "background.js"
"service_worker": "background.js",
"scripts": ["browser-polyfill.min.js", "background.js"]
},
"options_ui": {
"page": "options.html",
Expand All @@ -38,5 +38,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"
}
}
}