diff options
Diffstat (limited to 'source/features/open-issue-to-latest-comment.tsx')
-rw-r--r-- | source/features/open-issue-to-latest-comment.tsx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/features/open-issue-to-latest-comment.tsx b/source/features/open-issue-to-latest-comment.tsx new file mode 100644 index 00000000..c57d1276 --- /dev/null +++ b/source/features/open-issue-to-latest-comment.tsx @@ -0,0 +1,18 @@ +import select from 'select-dom'; +import features from '../libs/features'; + +function init(): void { + for (const link of select.all<HTMLAnchorElement>('.js-issue-row a[aria-label*="comment"]')) { + link.hash = '#partial-timeline'; + } +} + +features.add({ + id: 'open-issue-to-latest-comment', + description: 'Clicking the comments icon in issue lists will take you to latest comment.', + include: [ + features.isDiscussionList + ], + load: features.onAjaxedPages, + init +}); |