MediaWiki:Common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
$(function () { // Only run once everything is loaded const checkInterval = setInterval(function () { const headerTools = document.querySelector('.vector-header-end'); if (headerTools) { clearInterval(checkInterval); // Don't insert the link twice if (document.querySelector('#report-abuse-link')) return; // Create link const reportLink = document.createElement('a'); reportLink.id = 'report-abuse-link'; reportLink.href = mw.util.getUrl('Report_Animal_Abuse'); // Change to your actual target page reportLink.textContent = '🐾 Report Abuse'; reportLink.style.marginLeft = '1em'; reportLink.style.fontWeight = 'bold'; reportLink.style.color = '#d33'; // red color for attention // Insert before login link if present const loginLink = headerTools.querySelector('a[href*="Special:UserLogin"]'); if (loginLink) { headerTools.insertBefore(reportLink, loginLink); } else { headerTools.appendChild(reportLink); } console.log('[ReportAbuseLink] Inserted into header'); } }, 100); });