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.
/*This script adds a patrol tab to the cactions bar which marks the page as patrolled (it's a copy of the "[Mark as patrolled]" link at the bottom of the page) The tab only shows up if you have visited the page from newpages
*/
if(document.getElementsByClassName("patrollink").length>=1){
addOnloadHook(function () {
mw.util.addPortletLink('p-cactions',"http:\/\/en.wikipedia.org"+document.getElementsByClassName("patrollink")[0].childNodes[1],"Patrol","ca-patrol","Mark as patrolled","p")
})
}