MediaWiki:Common.js: Difference between revisions

m Fix
Tag: Reverted
m Another try to fix
Tag: Reverted
Line 50: Line 50:
});
});


// ---- WidgetBot Crate Widget ----
// WidgetBot: Discord Crate widget
$.getScript('https://cdn.jsdelivr.net/npm/@widgetbot/crate@3', function () {
$.getScript('https://cdn.jsdelivr.net/npm/@widgetbot/crate@3', function () {
     new Crate({
     new Crate({
Line 60: Line 60:
});
});


// ---- Custom Elements Built-in polyfill (Safari support) ----
// Safari polyfill for custom elements with built-in extends
(function () {
(function () {
     const ceBuiltinScript = document.createElement('script');
     var ceScript = document.createElement('script');
     ceBuiltinScript.src = 'https://unpkg.com/@ungap/custom-elements-builtin';
     ceScript.src = 'https://unpkg.com/@ungap/custom-elements-builtin';
     ceBuiltinScript.async = false;
     ceScript.async = false;
     document.head.appendChild(ceBuiltinScript);
    ceScript.onload = () => console.log('[Polyfill] custom-elements-builtin loaded');
     document.head.appendChild(ceScript);
})();
})();


// ---- X-Frame-Bypass loader ----
// X-Frame-Bypass module script (type=module) — MUST be loaded as type="module"
fetch('https://unpkg.com/x-frame-bypass')
(function () {
     .then(res => res.text())
    var bypassScript = document.createElement('script');
    .then(code => {
    bypassScript.type = 'module';
        const script = document.createElement('script');
    bypassScript.src = 'https://unpkg.com/x-frame-bypass';
        script.textContent = code;
     bypassScript.onload = () => console.log('[XFB] x-frame-bypass module loaded');
        document.head.appendChild(script);
    document.head.appendChild(bypassScript);
    })
})();
    .catch(err => console.error('Failed to load x-frame-bypass:', err));