summaryrefslogtreecommitdiff
path: root/source/features/remove-upload-files-button.tsx
blob: d4ee398d6ac7b5581ab1fedf18141c0c811619d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import select from 'select-dom';
import * as pageDetect from 'github-url-detection';

import features from '.';
import {getRepoURL} from '../github-helpers';

function init(): void {
	select(`.file-navigation a[href^="/${getRepoURL()}/upload"]`)?.remove();
}

features.add({
	id: __filebasename,
	description: 'Remove the "Upload files" button',
	screenshot: false
}, {
	include: [
		pageDetect.isRepoTree
	],
	repeatOnAjax: false,
	init
});