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>
|
</script>
|
||||||
|
|
||||||
<!-- Discord SDK for Activities -->
|
<!-- Discord SDK for Activities (loaded only in /discord context) -->
|
||||||
<script src="https://cdn.discordapp.com/assets/embedded/lazyload.min.js"></script>
|
|
||||||
<script>
|
<script>
|
||||||
// Initialize Discord SDK for Activity context
|
|
||||||
window.discordSdkReady = false;
|
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 {
|
try {
|
||||||
const { DiscordSDK } = await import('https://cdn.discordapp.com/assets/embedded/lazyload.min.js');
|
const { DiscordSDK } = await import('https://cdn.discordapp.com/assets/embedded/lazyload.min.js');
|
||||||
if (DiscordSDK) {
|
if (DiscordSDK) {
|
||||||
|
|
@ -202,14 +202,7 @@
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn('Discord SDK loading skipped (not in Activity context):', e.message);
|
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>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue