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
7 changes: 3 additions & 4 deletions content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,19 @@ function processFileDiff(fileDiffElement) {
}

function applySyntaxHighlighting() {
// Only apply highlighting if we're on a PR page
if (!window.location.href.includes('/_git/') || !window.location.href.includes('/pullrequest/')) {
if (!window.location.href.includes('/_git/')) {
return;
}

console.log("ADO Syntax Highlighter: Applying...");
console.debug("ADO Syntax Highlighter: Applying...");

const fileDiffPanels = document.querySelectorAll('.repos-summary-header');
fileDiffPanels.forEach(fileDiffPanel => {
processFileDiff(fileDiffPanel);
});
}

console.log("ADO Syntax Highlighter: Content script loaded.");
console.debug("ADO Syntax Highlighter: Content script loaded.");

// Initial run
applySyntaxHighlighting();
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema": "https://json.schemastore.org/chrome-manifest",
"manifest_version": 3,
"name": "Azure DevOps PR Syntax Highlighter",
"version": "0.1.1",
"version": "0.2.0",
"description": "Adds syntax highlighting to partial file diffs in Azure DevOps Pull Requests.",
"icons": {
"16": "assets/icons/icon16.png",
Expand Down