summaryrefslogtreecommitdiff
path: root/source/features/open-ci-details-in-new-tab.tsx
blob: d694c842ab00d06cd6d7be7e8b830c82f9414c6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import select from 'select-dom';
import * as pageDetect from 'github-url-detection';

import features from '.';

function init(): void {
	const CIDetailsLinks = select.all('a.status-actions');
	for (const link of CIDetailsLinks) {
		link.setAttribute('target', '_blank');
		link.setAttribute('rel', 'noopener');
	}
}

void features.add({
	id: __filebasename,
	description: 'Opens the Checks "details" link in a new tab.',
	screenshot: false
}, {
	include: [
		pageDetect.isPR
	],
	init
});