I put this in my Special:MyPage/global.js here on Community and it appears to work.
/* Edit button (classic editor) to right of page name header */ $(function () { var currServer = mw.config.get('wgServer'); var newPageName = wgPageName.replace(/\?/,"\%3F"); var newTitle = wgTitle; if (wgCanonicalNamespace) newTitle = wgCanonicalNamespace + ":" + wgTitle; $('#WikiaPageHeader > h1').after('<div style="float:right; margin-right:12px;"><a class="wikia-button" href="'+currServer+'/index.php?title=' + newPageName + '&action=edit">Edit</a></div>'); });
It should be legal, since it doesn't change any existing UI, but who knows.