MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
Adding JS for file preloading fix |
(No difference)
|
Revision as of 20:43, 10 December 2024
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener('DOMContentLoaded', function () {
// Select all videos embedded using [[File:...]] syntax
const embeddedVideos = document.querySelectorAll('video');
embeddedVideos.forEach(video => {
// Set preload attribute to "none"
video.setAttribute('preload', 'none');
});
});