@@ -61,17 +61,19 @@ TEST: addTests('isCompareWikiPage', [
6161 'https://github.com/brookhong/Surfingkeys/wiki/Color-Themes/_compare/8ebb46b1a12d16fc1af442b7df0ca13ca3bb34dc...80e51eeabe69b15a3f23880ecc36f800b71e6c6d' ,
6262] ) ;
6363
64+ /**
65+ * @deprecated Use `isHome` and/or `isFeed` instead
66+ */
6467export const isDashboard = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => ! isGist ( url ) && / ^ $ | ^ ( o r g s \/ [ ^ / ] + \/ ) ? d a s h b o a r d ( - f e e d ) ? ( \/ | $ ) / . test ( getCleanPathname ( url ) ) ;
6568TEST: addTests ( 'isDashboard' , [
6669 'https://github.com///' ,
6770 'https://github.com//' ,
6871 'https://github.com/' ,
6972 'https://github.com' ,
70- 'https://github.com/orgs/test /dashboard' ,
73+ 'https://github.com/orgs/refined-github /dashboard' ,
7174 'https://github.com/dashboard/index/2' ,
7275 'https://github.com//dashboard' ,
7376 'https://github.com/dashboard' ,
74- 'https://github.com/orgs/edit/dashboard' ,
7577 'https://github.big-corp.com/' ,
7678 'https://not-github.com/' ,
7779 'https://my-little-hub.com/' ,
@@ -84,6 +86,31 @@ TEST: addTests('isDashboard', [
8486 'https://github.com/dashboard-feed' ,
8587] ) ;
8688
89+ export const isHome = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => ! isGist ( url ) && / ^ $ | ^ d a s h b o a r d \/ ? $ / . test ( getCleanPathname ( url ) ) ;
90+ TEST: addTests ( 'isHome' , [
91+ 'https://github.com' ,
92+ 'https://github.com//dashboard' ,
93+ 'https://github.com///' ,
94+ 'https://github.com//' ,
95+ 'https://github.com/' ,
96+ 'https://github.com/dashboard' ,
97+ 'https://github.big-corp.com/' ,
98+ 'https://not-github.com/' ,
99+ 'https://my-little-hub.com/' ,
100+ 'https://github.com/?tab=repositories' , // Gotcha for `isUserProfileRepoTab`
101+ 'https://github.com/?tab=stars' , // Gotcha for `isUserProfileStarsTab`
102+ 'https://github.com/?tab=followers' , // Gotcha for `isUserProfileFollowersTab`
103+ 'https://github.com/?tab=following' , // Gotcha for `isUserProfileFollowingTab`
104+ 'https://github.com/?tab=overview' , // Gotcha for `isUserProfileMainTab`
105+ 'https://github.com?search=1' , // Gotcha for `isRepoTree`
106+ ] ) ;
107+
108+ export const isFeed = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => ! isGist ( url ) && / ^ ( f e e d | o r g s \/ [ ^ / ] + \/ d a s h b o a r d ) \/ ? $ / . test ( getCleanPathname ( url ) ) ;
109+ TEST: addTests ( 'isFeed' , [
110+ 'https://github.com/feed' ,
111+ 'https://github.com/orgs/refined-github/dashboard' ,
112+ ] ) ;
113+
87114export const isEnterprise = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => url . hostname !== 'github.com' && url . hostname !== 'gist.github.com' ;
88115TEST: addTests ( 'isEnterprise' , [
89116 'https://github.big-corp.com/' ,
0 commit comments