사용자:Ykhwong/AddEditLinkInSearchResult.js

참고: 설정을 저장한 후에 바뀐 점을 확인하기 위해서는 브라우저의 캐시를 새로 고쳐야 합니다. 구글 크롬, 파이어폭스, 마이크로소프트 엣지, 사파리: ⇧ Shift 키를 누른 채 "새로 고침" 버튼을 클릭하십시오. 더 자세한 정보를 보려면 위키백과:캐시 무시하기 항목을 참고하십시오.

$(function () {
	for ( var i = 0; i < $('.mw-search-result-heading').length; i++ ) {
		var htm = $('.mw-search-result-heading')[i];
		var link = '&nbsp;' + $($(htm).children(":first")[0]).prop('outerHTML')
		.replace(/\?.*/, '')
		.replace(/"\/wiki\//, '/w/index.php?title=')
		.replace(/ data-serp-pos="\d+"/, '');
		var editlink = link.replace(/" title="/, '&action=edit title="')
		.replace(/">(.+)<\/a>/, '">[Edit]</a>');
		var historylink = link.replace(/" title="/, '&action=history title="')
		.replace(/">(.+)<\/a>/, '">[History]</a>');
		$(htm).html($(htm).html() + editlink + historylink);
	}
});