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

function init(): false | void {
	const uploadFilesButton = select(`.file-navigation a[href^="/${getRepoURL()}/upload"]`);
	if (!uploadFilesButton) {
		return false;
	}

	uploadFilesButton.remove();
}

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