MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary Tag: Reverted |
||
| 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. */ | ||
document.addEventListener('DOMContentLoaded', function() { | |||
document.querySelectorAll('a[href]').forEach(function(link) { | |||
if (link.href.includes('example.com')) { // filter for your popup URLs | |||
link.addEventListener('click', function(e){ | |||
e.preventDefault(); | |||
window.open(link.href, 'popupWindow', 'width=600,height=400,scrollbars=yes,resizable=yes'); | |||
}); | |||
} | |||
}); | |||
}); | |||
Revision as of 21:10, 6 September 2025
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('a[href]').forEach(function(link) {
if (link.href.includes('example.com')) { // filter for your popup URLs
link.addEventListener('click', function(e){
e.preventDefault();
window.open(link.href, 'popupWindow', 'width=600,height=400,scrollbars=yes,resizable=yes');
});
}
});
});