Remove blocking Discord SDK script to fix CORS issue
cgen-82b339983d994a1a8a373bb78daf682e
This commit is contained in:
parent
4e18d6c7a5
commit
bb732847f7
1 changed files with 5 additions and 12 deletions
17
index.html
17
index.html
|
|
@ -184,13 +184,13 @@
|
|||
})();
|
||||
</script>
|
||||
|
||||
<!-- Discord SDK for Activities -->
|
||||
<script src="https://cdn.discordapp.com/assets/embedded/lazyload.min.js"></script>
|
||||
<!-- Discord SDK for Activities (loaded only in /discord context) -->
|
||||
<script>
|
||||
// Initialize Discord SDK for Activity context
|
||||
window.discordSdkReady = false;
|
||||
|
||||
async function loadDiscordSDK() {
|
||||
// Only attempt to load Discord SDK if we're in the Discord Activity route
|
||||
window.loadDiscordSDK = async function() {
|
||||
if (window.discordSdkReady) return;
|
||||
try {
|
||||
const { DiscordSDK } = await import('https://cdn.discordapp.com/assets/embedded/lazyload.min.js');
|
||||
if (DiscordSDK) {
|
||||
|
|
@ -202,14 +202,7 @@
|
|||
} catch (e) {
|
||||
console.warn('Discord SDK loading skipped (not in Activity context):', e.message);
|
||||
}
|
||||
}
|
||||
|
||||
// Attempt to load Discord SDK
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', loadDiscordSDK);
|
||||
} else {
|
||||
loadDiscordSDK();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue