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
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v25.8.1
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ Choose from six icon themes in the extension popup:

## Install

The extension is currently under review by the Chrome Web Store. In the meantime, build and load it locally:
[**Chrome Web Store**](https://chromewebstore.google.com/detail/github-icons/hjhebcpkgfacibbiohdccepipeekkjlj)

Safari and Firefox versions should be available soon!

Or build and load it locally:

```bash
git clone https://github.com/g-icons/github-icons
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "chrome-github-icons",
"description": "Cross-browser extension that replaces GitHub file icons with Material Design icons.",
"private": true,
"version": "0.5.0",
"version": "0.5.1",
"type": "module",
"scripts": {
"sync:assets": "tsx scripts/copy-icons.ts",
Expand All @@ -13,6 +13,8 @@
"build:firefox": "npm run sync:assets && wxt build -b firefox",
"build:safari": "npm run sync:assets && wxt build -b safari",
"chrome": "npm run sync:assets && wxt zip",
"firefox": "npm run sync:assets && wxt zip -b firefox",
"safari": "npm run sync:assets && wxt zip -b safari",
"zip": "npm run sync:assets && wxt zip",
"zip:firefox": "npm run sync:assets && wxt zip -b firefox",
"compile": "tsc --noEmit",
Expand Down
18 changes: 9 additions & 9 deletions src/adapters/github/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ export class GitHubAdapter implements SiteAdapter {

originalIcon.style.display = 'none';

if (existingReplacement) {
existingReplacement.src = iconUrl;
return;
}

// Remove orphaned replacement images in the same parent.
// In the sidebar, React swaps between closed/open folder SVGs — the old
// SVG is removed but our <img> replacement stays behind.
// Clean up any orphaned replacement images in the same parent
// (happens when GitHub swaps SVGs for open/closed folder states)
const parent = originalIcon.parentElement;
if (parent) {
parent.querySelectorAll<HTMLImageElement>(`img[${REPLACEMENT_ATTR}="true"]`)
parent
.querySelectorAll<HTMLImageElement>(`img[${REPLACEMENT_ATTR}="true"]`)
.forEach((orphan) => orphan.remove());
}

if (existingReplacement) {
existingReplacement.src = iconUrl;
return;
}

const replacement = this.createReplacementImage(originalIcon, iconUrl);
originalIcon.insertAdjacentElement('afterend', replacement);
}
Expand Down
5 changes: 3 additions & 2 deletions src/adapters/github/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export const GITHUB_ICON_SELECTOR = 'svg[class*="octicon-file"]';

const GITHUB_ENTRY_CONTAINER_SELECTOR = [
'.react-directory-row',
'.PRIVATE_TreeView-item-container',
'[data-testid="tree-view-item"]',
'[role="treeitem"]',
'[data-testid="tree-view-item"]',
'.PRIVATE_TreeView-item-container',
'.PRIVATE_TreeView-item-content',
'tr.js-navigation-item',
'li.js-navigation-item',
'div[role="row"]',
Expand Down
4 changes: 2 additions & 2 deletions ssmver.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "0.5.0"
version = "0.5.1"

[settings]
mode = "branch"
Expand All @@ -11,7 +11,7 @@ prompt_prefixes = [
[sync]
monorepo = "lockstep"
constants = "curated"
exclude = []
exclude = ["test/**"]

[prefixes]
feature = "minor"
Expand Down
Loading