@@ -202,9 +202,10 @@ export const isOwnUserProfile = (): boolean => getCleanPathname() === getLoggedI
202202// If there's a Report Abuse link, we're not part of the org
203203export const isOwnOrganizationProfile = ( ) : boolean => isOrganizationProfile ( ) && ! exists ( '[href*="contact/report-abuse?report="]' ) ;
204204
205- export const isProject = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p r o j e c t s \/ \d + / . test ( getRepo ( url ) ?. path ) ;
205+ export const isProject = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p r o j e c t s \/ \d + / . test ( getRepo ( url ) ?. path ?? getOrg ( url ) ?. path ) ;
206206TEST: addTests ( 'isProject' , [
207207 'https://github.com/sindresorhus/refined-github/projects/3' ,
208+ 'https://github.com/orgs/RSSNext/projects/3' ,
208209] ) ;
209210
210211export const isProjects = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === 'projects' ;
@@ -253,10 +254,13 @@ TEST: addTests('isPRList', [
253254 'https://github.com/sindresorhus/refined-github/pulls?q=is%3Apr+is%3Aclosed' ,
254255] ) ;
255256
256- export const isPRCommit = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p u l l \/ \d + \/ c o m m i t s \/ [ \d a - f ] { 5 , 40 } $ / . test ( getRepo ( url ) ?. path ) ;
257+ export const isPRCommit = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p u l l \/ \d + \/ ( c o m m i t s | c h a n g e s ) \/ [ \d a - f ] { 7 , 40 } $ / . test ( getRepo ( url ) ?. path ) ;
257258TEST: addTests ( 'isPRCommit' , [
258- 'https://github.com/sindresorhus/refined-github/pull/148/commits/0019603b83bd97c2f7ef240969f49e6126c5ec85' ,
259- 'https://github.com/sindresorhus/refined-github/pull/148/commits/00196' ,
259+ 'https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d7998afdd3608d9fc3bf95ccf27fa5010641' ,
260+ 'https://github.com/sindresorhus/refined-github/pull/148/commits/1e27d79' ,
261+ // Since December 2025
262+ 'https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641' ,
263+ 'https://github.com/sindresorhus/refined-github/pull/148/changes/1e27d79' ,
260264] ) ;
261265
262266export const isPRCommit404 = ( ) : boolean => isPRCommit ( ) && document . title . startsWith ( 'Commit range not found · Pull Request' ) ;
@@ -272,12 +276,16 @@ TEST: addTests('isPRCommitList', [
272276 'https://github.com/sindresorhus/refined-github/pull/148/commits' ,
273277] ) ;
274278
275- export const isPRFiles = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p u l l \/ \d + \/ f i l e s / . test ( getRepo ( url ) ?. path ) || isPRCommit ( url ) ;
279+ export const isPRFiles = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ p u l l \/ \d + \/ ( f i l e s | ( c h a n g e s ( \/ [ \d a - f ] { 7 , 40 } .. [ \d a - f ] { 7 , 40 } ) ? $ ) ) / . test ( getRepo ( url ) ?. path ) || isPRCommit ( url ) ;
276280TEST: addTests ( 'isPRFiles' , [
277281 'isPRCommit' , // File contents but lacks "Viewed" checkbox, has commit information
278282 'https://github.com/sindresorhus/refined-github/pull/148/files' ,
279283 'https://github.com/sindresorhus/refined-github/pull/148/files/e1aba6f' , // This means "every commit until e1aba6f"
280284 'https://github.com/sindresorhus/refined-github/pull/148/files/1e27d799..e1aba6f' , // This means specifically "Between commit A and B"
285+ // Since December 2025
286+ 'https://github.com/refined-github/refined-github/pull/148/changes' ,
287+ 'https://github.com/refined-github/refined-github/pull/148/changes/1e27d799..e1aba6f' , // This means specifically "Between commit A and B"
288+ 'https://github.com/refined-github/refined-github/pull/148/changes/1e27d7998afdd3608d9fc3bf95ccf27fa5010641..e1aba6febb3fe38aafd1137cff28b536eeeabe7e' ,
281289] ) ;
282290
283291export const isQuickPR = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isCompare ( url ) && / [ ? & ] q u i c k _ p u l l = 1 ( & | $ ) / . test ( url . search ) ;
@@ -613,6 +621,11 @@ TEST: addTests('isRepoNetworkGraph', [
613621
614622export const isForkedRepo = ( ) : boolean => exists ( 'meta[name="octolytics-dimension-repository_is_fork"][content="true"]' ) ;
615623
624+ export const isForkingRepo = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => getRepo ( url ) ?. path === 'fork' ;
625+ TEST: addTests ( 'isForkingRepo' , [
626+ 'https://github.com/refined-github/refined-github/fork' ,
627+ ] ) ;
628+
616629export const isSingleGist = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ [ ^ / ] + \/ [ \d a - f ] { 20 , 32 } ( \/ [ \d a - f ] { 40 } ) ? $ / . test ( getCleanGistPathname ( url ) ) ;
617630TEST: addTests ( 'isSingleGist' , [
618631 'https://gist.github.com/fregante/2205329b71218fa2c1d3' ,
@@ -757,6 +770,16 @@ export const hasCode = (url: URL | HTMLAnchorElement | Location = location): boo
757770 || isCompareWikiPage ( url )
758771 || isBlame ( url ) ;
759772
773+ TEST: addTests ( 'isRepoGitObject' , [
774+ 'isRepoTree' ,
775+ 'isSingleFile' ,
776+ 'isBlame' ,
777+ ] ) ;
778+ /** Covers blob, trees and blame pages */
779+ export const isRepoGitObject = ( url : URL | HTMLAnchorElement | Location = location ) : boolean =>
780+ isRepo ( url )
781+ && [ undefined , 'blob' , 'tree' , 'blame' ] . includes ( getCleanPathname ( url ) . split ( '/' ) [ 2 ] ) ;
782+
760783TEST: addTests ( 'hasFiles' , combinedTestOnly ) ;
761784/** Has a list of files */
762785export const hasFiles = ( url : URL | HTMLAnchorElement | Location = location ) : boolean =>
0 commit comments