MediaWiki:Common.js: Difference between revisions
Blanked the page Tags: Blanking Reverted |
No edit summary Tag: Manual revert |
||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | |||
if (!mw.config.get('wgUserName')) { | |||
const observer = new MutationObserver((mutationsList, observer) => { | |||
for (const mutation of mutationsList) { | |||
if (mutation.target.classList.contains('vector-animations-ready')) { | |||
document.querySelector( '[data-event-name="pinnable-header.vector-main-menu.pin"]' ).click() | |||
observer.disconnect(); | |||
break; | |||
} | |||
} | |||
}); | |||
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] }); | |||
} | |||