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
262262 ! reservedNames . includes ( url . pathname . split ( '/' , 2 ) [ 1 ] ! ) &&
263263 ! isDashboard ( url ) &&
264264 ! isGist ( url ) &&
265- ! isRepoSearch ( url ) ;
265+ ! isRepoSearch ( url ) &&
266+ ! isNewRepoTemplate ( url ) ;
266267collect . set ( 'isRepo' , [
267268 // Some of these are here simply as "gotchas" to other detections
268269 'https://github.com/sindresorhus/refined-github/blame/master/package.json' ,
@@ -534,6 +535,12 @@ collect.set('isNewRepo', [
534535 'https://github.com/organizations/npmhub/repositories/new' ,
535536] ) ;
536537
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+
537544/** Get the logged-in user’s username */
538545const getUsername = ( ) => document . querySelector ( 'meta[name="user-login"]' ) ! . getAttribute ( 'content' ) ! ;
539546
You can’t perform that action at this time.
0 commit comments