summaryrefslogtreecommitdiff
path: root/source/features/remove-upload-files-button.tsx
blob: a926a7fd56ffd4d07ebdd588dea7b03e694eb204 (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 '../libs/features';
import {getRepoURL} from '../libs/utils';

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
});