|
|
| Line 1: |
Line 1: |
| mw.loader.using('mediawiki.util', function () {
| | console.log("✅ MediaWiki:Common.js is loading!"); |
| function debugUserMenuInjection() {
| |
| if (!mw.config.get('wgUserName')) {
| |
| console.log('[UserMenuTest] Not logged in.');
| |
| return;
| |
| }
| |
| | |
| const $menu = $('.cmln-personal-tools ul');
| |
| | |
| if ($menu.length === 0) {
| |
| console.log('[UserMenuTest] Menu not found, retrying...');
| |
| setTimeout(debugUserMenuInjection, 200);
| |
| return;
| |
| }
| |
| | |
| console.log('[UserMenuTest] Menu found. Injecting link.');
| |
| | |
| const $testLink = $('<li>')
| |
| .addClass('mw-list-item')
| |
| .append(
| |
| $('<a>')
| |
| .attr('href', '#')
| |
| .text('✅ Injected Link')
| |
| .css({
| |
| background: 'firebrick',
| |
| color: 'white',
| |
| padding: '5px',
| |
| display: 'block'
| |
| })
| |
| );
| |
| | |
| $menu.append($testLink);
| |
| }
| |
| | |
| $(debugUserMenuInjection);
| |
| });
| |
Revision as of 20:35, 14 July 2025
console.log("✅ MediaWiki:Common.js is loading!");