|
|
| (2 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| /* Any JavaScript here will be loaded for all users on every page load. */ | | /* 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'] });
| |
| }
| |