User:The Voidwalker/alwaysEditSectionLink.js

Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// Makes edit section links appear everywhere they don't exist but probably should. Only probably, they might turn up in unexpected places.

if(mw.config.get('wgAction') === 'view' && $('.mw-heading').length > 0 && $('.mw-editsection').length == 0 && mw.config.get('wgIsProbablyEditable')) {
	$('.mw-heading').append((i, html) => {
		var link = mw.util.getUrl(mw.config.get('wgPageName'), {action: "edit", section: i + 1});
		return $('<span>')
			.addClass('mw-editsection')
			.append(
				$('<span>')
					.addClass('mw-editsection-bracket')
					.text('['),
				$('<a>')
					.attr('href', link)
					.text('edit source'),
				$('<span>')
					.addClass('mw-editsection-bracket')
					.text(']')
			);
	});
}