From 4b5ed7734c7dd4252a9f07798facf3de64164b69 Mon Sep 17 00:00:00 2001 From: Grigory Date: Thu, 8 Jan 2026 20:29:49 +0500 Subject: [PATCH 1/3] `isPRFiles` - Handle new URL format --- index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 423b825e..44a20bb4 100644 --- a/index.ts +++ b/index.ts @@ -276,12 +276,16 @@ TEST: addTests('isPRCommitList', [ 'https://github.com/sindresorhus/refined-github/pull/148/commits', ]); -export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/files/.test(getRepo(url)?.path) || isPRCommit(url); +export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/(files|changes)/.test(getRepo(url)?.path) || isPRCommit(url); TEST: addTests('isPRFiles', [ 'isPRCommit', // File contents but lacks "Viewed" checkbox, has commit information 'https://github.com/sindresorhus/refined-github/pull/148/files', 'https://github.com/sindresorhus/refined-github/pull/148/files/e1aba6f', // This means "every commit until e1aba6f" 'https://github.com/sindresorhus/refined-github/pull/148/files/1e27d799..e1aba6f', // This means specifically "Between commit A and B" + // Since December 2025 + 'https://github.com/refined-github/refined-github/pull/148/changes', + 'https://github.com/refined-github/refined-github/pull/148/changes/e1aba6f', // This means "every commit until e1aba6f" + 'https://github.com/refined-github/refined-github/pull/148/changes/1e27d799..e1aba6f', // This means specifically "Between commit A and B" ]); export const isQuickPR = (url: URL | HTMLAnchorElement | Location = location): boolean => isCompare(url) && /[?&]quick_pull=1(&|$)/.test(url.search); From 2b82badfcf5650a3958c1f2a2ed8c4b2f9041605 Mon Sep 17 00:00:00 2001 From: Grigory Date: Thu, 8 Jan 2026 23:58:00 +0500 Subject: [PATCH 2/3] correct regex and test urls --- index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 44a20bb4..ae57b139 100644 --- a/index.ts +++ b/index.ts @@ -276,7 +276,7 @@ TEST: addTests('isPRCommitList', [ 'https://github.com/sindresorhus/refined-github/pull/148/commits', ]); -export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/(files|changes)/.test(getRepo(url)?.path) || isPRCommit(url); +export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/(files|(changes$|changes\/[\da-f]{7,40}..[\da-f]{7,40}$))/.test(getRepo(url)?.path) || isPRCommit(url); TEST: addTests('isPRFiles', [ 'isPRCommit', // File contents but lacks "Viewed" checkbox, has commit information 'https://github.com/sindresorhus/refined-github/pull/148/files', @@ -284,8 +284,8 @@ TEST: addTests('isPRFiles', [ 'https://github.com/sindresorhus/refined-github/pull/148/files/1e27d799..e1aba6f', // This means specifically "Between commit A and B" // Since December 2025 'https://github.com/refined-github/refined-github/pull/148/changes', - 'https://github.com/refined-github/refined-github/pull/148/changes/e1aba6f', // This means "every commit until e1aba6f" 'https://github.com/refined-github/refined-github/pull/148/changes/1e27d799..e1aba6f', // This means specifically "Between commit A and B" + 'https://github.com/refined-github/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641..e1aba6febb3fe38aafd1137cff28b536eeeabe7e', ]); export const isQuickPR = (url: URL | HTMLAnchorElement | Location = location): boolean => isCompare(url) && /[?&]quick_pull=1(&|$)/.test(url.search); From 76c918fb0e7e472f7019177dd41cbc89e5b6cae8 Mon Sep 17 00:00:00 2001 From: Grigory Date: Fri, 9 Jan 2026 15:55:21 +0500 Subject: [PATCH 3/3] update regex Co-authored-by: fregante --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index ae57b139..dccb9658 100644 --- a/index.ts +++ b/index.ts @@ -276,7 +276,7 @@ TEST: addTests('isPRCommitList', [ 'https://github.com/sindresorhus/refined-github/pull/148/commits', ]); -export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/(files|(changes$|changes\/[\da-f]{7,40}..[\da-f]{7,40}$))/.test(getRepo(url)?.path) || isPRCommit(url); +export const isPRFiles = (url: URL | HTMLAnchorElement | Location = location): boolean => /^pull\/\d+\/(files|(changes(\/[\da-f]{7,40}..[\da-f]{7,40})?$))/.test(getRepo(url)?.path) || isPRCommit(url); TEST: addTests('isPRFiles', [ 'isPRCommit', // File contents but lacks "Viewed" checkbox, has commit information 'https://github.com/sindresorhus/refined-github/pull/148/files',