MediaWiki:Common.js: Difference between revisions
From JP1 Remotes Wiki
Jump to navigationJump to search
The Robman (talk | contribs) No edit summary |
The Robman (talk | contribs) No edit summary |
||
| 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. */ | ||
(function() { | (function() { | ||
const | const target = document.querySelector('.mw-wiki-logo'); | ||
if (target) { | |||
target.removeAttribute('style'); | |||
} | |||
} | |||
const | const observer = new MutationObserver(mutations => { | ||
mutations.forEach(m => { | |||
if (m.type === 'attributes' && m.attributeName === 'style') { | if (m.type === 'attributes' && m.attributeName === 'style') { | ||
m.target.removeAttribute('style'); | |||
} | } | ||
}); | |||
}); | }); | ||
if (target) { | |||
observer.observe(target, { attributes: true }); | |||
} | |||
})(); | })(); | ||
Revision as of 15:49, 18 November 2025
/* Any JavaScript here will be loaded for all users on every page load. */
(function() {
const target = document.querySelector('.mw-wiki-logo');
if (target) {
target.removeAttribute('style');
}
const observer = new MutationObserver(mutations => {
mutations.forEach(m => {
if (m.type === 'attributes' && m.attributeName === 'style') {
m.target.removeAttribute('style');
}
});
});
if (target) {
observer.observe(target, { attributes: true });
}
})();