MediaWiki:Common.js: Difference between revisions

m Make color of Discord button black
mNo edit summary
Tag: Reverted
Line 53: Line 53:


$(document).ready(function() {
$(document).ready(function() {
     // Dynamically load the external script
     // Dynamically load the external script for WidgetBot Crate
     $.getScript('https://cdn.jsdelivr.net/npm/@widgetbot/crate@3', function() {
     $.getScript('https://cdn.jsdelivr.net/npm/@widgetbot/crate@3', function() {
        // Once the script is loaded, initialize the Crate widget
         new Crate({
         new Crate({
             server: '1163030464903258122', // The 'Good Creations!' Minecraft Server
             server: '1163030464903258122', // The 'Good Creations!' Minecraft Server
Line 63: Line 62:
         });
         });
     });
     });
    // Load the Custom Elements Built-in polyfill for Safari
    const ceBuiltinScript = document.createElement('script');
    ceBuiltinScript.src = 'https://unpkg.com/@ungap/custom-elements-builtin';
    ceBuiltinScript.async = false;
    document.head.appendChild(ceBuiltinScript);
    // Load the x-frame-bypass script and inject as classic script
    fetch('https://unpkg.com/x-frame-bypass')
        .then(res => res.text())
        .then(code => {
            const script = document.createElement('script');
            script.textContent = code;
            document.head.appendChild(script);
        })
        .catch(err => console.error('Failed to load x-frame-bypass:', err));
});
});