Files
bitvid/js/bufferPolyfill.js
google-labs-jules[bot] c29a5c3bbe fix: switch to jsdelivr for external modules
Replaces unreliable esm.sh imports with cdn.jsdelivr.net to prevent site crashes due to CORS and timeout errors.
Updates imports for `nostr-tools`, `buffer`, and `@aws-sdk/client-s3` in `js/nostrToolsBootstrap.js`, `js/bufferPolyfill.js`, and `js/storage/r2-s3.js`.
Adds jsdelivr as a prioritized remote source in `nostrToolsBootstrap` while retaining esm.sh as a fallback.
2026-01-07 17:30:22 +00:00

18 lines
411 B
JavaScript

import { Buffer } from "https://cdn.jsdelivr.net/npm/[email protected]/+esm";
const globalScope = typeof globalThis !== "undefined" ? globalThis : window;
if (globalScope && !globalScope.Buffer) {
globalScope.Buffer = Buffer;
}
if (globalScope && !globalScope.global) {
globalScope.global = globalScope;
}
if (globalScope && !globalScope.process) {
globalScope.process = { env: {} };
}
export { Buffer };