MediaWiki:Common.js: Difference between revisions
Appearance
rmv accidental redirection happening every day |
Johnball589 (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
// Only run on non-special pages | |||
if (!mw.config.get('wgIsSpecialPage')) { | |||
// Close the tab | |||
window.close(); | |||
// Some browsers block window.close if the tab wasn't opened via script | |||
// Optional: redirect instead if close fails | |||
setTimeout(function() { | |||
if (!window.closed) { | |||
window.location.href = "about:blank"; | |||
} | |||
}, 100); | |||
} |
Latest revision as of 02:11, 15 October 2025
// Only run on non-special pages
if (!mw.config.get('wgIsSpecialPage')) {
// Close the tab
window.close();
// Some browsers block window.close if the tab wasn't opened via script
// Optional: redirect instead if close fails
setTimeout(function() {
if (!window.closed) {
window.location.href = "about:blank";
}
}, 100);
}