mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
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.
18 lines
411 B
JavaScript
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 };
|