From 66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Thu, 1 Oct 2026 16:34:55 -0700 Subject: The standalone wallet opened from a disk shows its avatars, font and languages. With no files beside it, relative punks/, locales/, nip46.js and jsqr.js looked on the disk. From file:// they now come from v3.coinos.io (images and scripts need no CORS; /locales/ now sends Access-Control-Allow-Origin on the server), and standalone.html carries Public Sans inline. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VP5Ljqk7EYcm5QQAbzDwog --- src/asset-url.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/asset-url.js (limited to 'src/asset-url.js') diff --git a/src/asset-url.js b/src/asset-url.js new file mode 100644 index 0000000..bd80240 --- /dev/null +++ b/src/asset-url.js @@ -0,0 +1,6 @@ +// The standalone wallet (standalone.html opened from a disk) has no files +// beside it: punks, the lazy modules and the language packs come from the +// site instead. Served from anywhere else, paths stay relative. +export const SITE = 'https://v3.coinos.io/'; +const fromDisk = () => typeof location !== 'undefined' && location.protocol === 'file:'; +export const assetUrl = (path) => fromDisk() ? SITE + path.replace(/^\//, '') : path; -- cgit v1.2.3