File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -262,7 +262,8 @@ export const isRepo = (url: URL | HTMLAnchorElement | Location = location): bool
262
262
! reservedNames . includes ( url . pathname . split ( '/' , 2 ) [ 1 ] ! ) &&
263
263
! isDashboard ( url ) &&
264
264
! isGist ( url ) &&
265
- ! isRepoSearch ( url ) ;
265
+ ! isRepoSearch ( url ) &&
266
+ ! isNewRepoTemplate ( url ) ;
266
267
collect . set ( 'isRepo' , [
267
268
// Some of these are here simply as "gotchas" to other detections
268
269
'https://github.com/sindresorhus/refined-github/blame/master/package.json' ,
@@ -534,6 +535,12 @@ collect.set('isNewRepo', [
534
535
'https://github.com/organizations/npmhub/repositories/new' ,
535
536
] ) ;
536
537
538
+ // This can't use `getRepo().path` to avoid infinite recursion:
539
+ export const isNewRepoTemplate = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => Boolean ( url . pathname . split ( '/' ) [ 3 ] === 'generate' ) ;
540
+ collect . set ( 'isNewRepoTemplate' , [
541
+ 'https://github.com/fregante/browser-extension-template/generate' ,
542
+ ] ) ;
543
+
537
544
/** Get the logged-in user’s username */
538
545
const getUsername = ( ) => document . querySelector ( 'meta[name="user-login"]' ) ! . getAttribute ( 'content' ) ! ;
539
546
You can’t perform that action at this time.
0 commit comments