@@ -298,16 +298,25 @@ collect.set('isEditingFile', [
298
298
'https://github.com/sindresorhus/refined-github/edit/ghe-injection/source/background.ts' ,
299
299
] ) ;
300
300
301
+ export const hasFileEditor = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isEditingFile ( url ) || isNewFile ( url ) || isDeletingFile ( url ) ;
302
+ collect . set ( 'hasFileEditor' , combinedTestOnly ) ;
303
+
301
304
export const isEditingRelease = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => Boolean ( getRepo ( url ) ?. path . startsWith ( 'releases/edit' ) ) ;
302
305
collect . set ( 'isEditingRelease' , [
303
306
'https://github.com/sindresorhus/refined-github/releases/edit/v1.2.3' ,
304
307
] ) ;
305
308
309
+ export const hasReleaseEditor = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isEditingRelease ( url ) || isNewRelease ( url ) ;
310
+ collect . set ( 'hasReleaseEditor' , combinedTestOnly ) ;
311
+
306
312
export const isEditingWikiPage = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isRepoWiki ( url ) && getCleanPathname ( url ) . endsWith ( '/_edit' ) ;
307
313
collect . set ( 'isEditingWikiPage' , [
308
314
'https://github.com/tooomm/wikitest/wiki/Getting-Started/_edit' ,
309
315
] ) ;
310
316
317
+ export const hasWikiPageEditor = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => isEditingWikiPage ( url ) || isNewWikiPage ( url ) ;
318
+ collect . set ( 'hasWikiPageEditor' , combinedTestOnly ) ;
319
+
311
320
export const isRepo = ( url : URL | HTMLAnchorElement | Location = location ) : boolean => / ^ [ ^ / ] + \/ [ ^ / ] + / . test ( getCleanPathname ( url ) )
312
321
&& ! reservedNames . includes ( url . pathname . split ( '/' , 2 ) [ 1 ] ! )
313
322
&& ! isDashboard ( url )
@@ -580,7 +589,7 @@ export const hasRichTextEditor = (url: URL | HTMLAnchorElement | Location = loca
580
589
|| isNewIssue ( url )
581
590
|| isCompare ( url )
582
591
|| isRepliesSettings ( url )
583
- || isNewRelease ( url )
592
+ || hasReleaseEditor ( url )
584
593
|| isDiscussion ( url ) ;
585
594
586
595
collect . set ( 'hasCode' , combinedTestOnly ) ;
0 commit comments