From c6cd8ae4f5725d3f862309064735a92336a719bd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 10:03:36 +0000 Subject: [PATCH 1/4] Initial plan From f85a24c5ed72461f0701e8b32986e06033312ba5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 10:09:20 +0000 Subject: [PATCH 2/4] Add test URL for wiki diff detection Co-authored-by: fregante <1402241+fregante@users.noreply.github.com> --- index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.ts b/index.ts index 3e9988b..40dc67a 100644 --- a/index.ts +++ b/index.ts @@ -61,6 +61,7 @@ export const isCompareWikiPage = (url: URL | HTMLAnchorElement | Location = loca TEST: addTests('isCompareWikiPage', [ 'https://github.com/brookhong/Surfingkeys/wiki/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', 'https://github.com/brookhong/Surfingkeys/wiki/Color-Themes/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', + 'https://github.com/refined-github/refined-github/wiki/Home/_compare/b64098961263e40d985aaf7c5c03ef6f2ce4beda...ae9e6e8443a39323823748a1645e8acd4cf39dde', ]); export const isDashboard = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^(orgs\/[^/]+\/)?dashboard(-feed)?(\/|$)/.test(getCleanPathname(url)); @@ -583,6 +584,7 @@ TEST: addTests('isRepoWiki', [ 'https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit', 'https://github.com/brookhong/Surfingkeys/wiki/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', 'https://github.com/brookhong/Surfingkeys/wiki/Color-Themes/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', + 'https://github.com/refined-github/refined-github/wiki/Home/_compare/b64098961263e40d985aaf7c5c03ef6f2ce4beda...ae9e6e8443a39323823748a1645e8acd4cf39dde', ]); export const isSingleCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^commit\/[\da-f]{5,40}$/.test(getRepo(url)?.path); From 9f7f34ec3937f59faa2be61d8fe97df2ab91485b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 10:18:44 +0000 Subject: [PATCH 3/4] Add isWikiRevision to detect wiki revision pages in hasCode Co-authored-by: fregante <1402241+fregante@users.noreply.github.com> --- index.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/index.ts b/index.ts index 40dc67a..290fdc6 100644 --- a/index.ts +++ b/index.ts @@ -64,6 +64,22 @@ TEST: addTests('isCompareWikiPage', [ 'https://github.com/refined-github/refined-github/wiki/Home/_compare/b64098961263e40d985aaf7c5c03ef6f2ce4beda...ae9e6e8443a39323823748a1645e8acd4cf39dde', ]); +export const isWikiRevision = (url: URL | HTMLAnchorElement | Location = location): boolean => { + if (!isRepoWiki(url)) { + return false; + } + + const parts = getCleanPathname(url).split('/'); + // Wiki/Page/hash or wiki/Page/_history patterns + // Parts: [owner, repo, 'wiki', pageName, revisionOrSpecial, ...] + return parts.length >= 5 && /^[\da-f]{5,40}$/.test(parts[4]); +}; + +TEST: addTests('isWikiRevision', [ + 'https://github.com/refined-github/refined-github/wiki/Home/b64098961263e40d985aaf7c5c03ef6f2ce4beda', + 'https://github.com/pixiebrix/pixiebrix-extension/wiki/Web-Extensions-behaviors/664a8f7', +]); + export const isDashboard = (url: URL | HTMLAnchorElement | Location = location): boolean => !isGist(url) && /^$|^(orgs\/[^/]+\/)?dashboard(-feed)?(\/|$)/.test(getCleanPathname(url)); TEST: addTests('isDashboard', [ 'https://github.com///', @@ -585,6 +601,8 @@ TEST: addTests('isRepoWiki', [ 'https://github.com/brookhong/Surfingkeys/wiki/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', 'https://github.com/brookhong/Surfingkeys/wiki/Color-Themes/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d', 'https://github.com/refined-github/refined-github/wiki/Home/_compare/b64098961263e40d985aaf7c5c03ef6f2ce4beda...ae9e6e8443a39323823748a1645e8acd4cf39dde', + 'https://github.com/refined-github/refined-github/wiki/Home/b64098961263e40d985aaf7c5c03ef6f2ce4beda', + 'https://github.com/pixiebrix/pixiebrix-extension/wiki/Web-Extensions-behaviors/664a8f7', ]); export const isSingleCommit = (url: URL | HTMLAnchorElement | Location = location): boolean => /^commit\/[\da-f]{5,40}$/.test(getRepo(url)?.path); @@ -803,6 +821,7 @@ export const hasCode = (url: URL | HTMLAnchorElement | Location = location): boo || isGist(url) || isCompare(url) || isCompareWikiPage(url) + || isWikiRevision(url) || isBlame(url); TEST: addTests('isRepoGitObject', [ From 2c9853a9dbe1026a8dfe0c45be71990781249d85 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 24 Jan 2026 10:21:07 +0000 Subject: [PATCH 4/4] Clarify isWikiRevision comments to reflect actual implementation Co-authored-by: fregante <1402241+fregante@users.noreply.github.com> --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 290fdc6..a6678f9 100644 --- a/index.ts +++ b/index.ts @@ -70,8 +70,8 @@ export const isWikiRevision = (url: URL | HTMLAnchorElement | Location = locatio } const parts = getCleanPathname(url).split('/'); - // Wiki/Page/hash or wiki/Page/_history patterns - // Parts: [owner, repo, 'wiki', pageName, revisionOrSpecial, ...] + // Wiki/Page/hash pattern - detects specific revision views + // Parts: [owner, repo, 'wiki', pageName, revisionHash, ...] return parts.length >= 5 && /^[\da-f]{5,40}$/.test(parts[4]); };