diff --git a/src/pages/account.html b/src/pages/account.html index bdf8dc4..cf243b4 100644 --- a/src/pages/account.html +++ b/src/pages/account.html @@ -1,14 +1,13 @@
- - + + + diff --git a/src/pages/account.js b/src/pages/account.js index c9a2a33..eaae086 100644 --- a/src/pages/account.js +++ b/src/pages/account.js @@ -5,7 +5,8 @@ const sharedKeys = { window.addEventListener('DOMContentLoaded', e => { setTimeout(() => { - const key = !!globalThis.__args.env.DEV ? sharedKeys.test : sharedKeys.live + const url = new URL(globalThis.location.href) + const key = url.searchParams.get('dev') === 'true' ? sharedKeys.test : sharedKeys.live const stripe = Stripe(key) const elements = stripe.elements() diff --git a/src/views/home.js b/src/views/home.js index 4eaad3f..576c3dd 100644 --- a/src/views/home.js +++ b/src/views/home.js @@ -25,7 +25,7 @@ class ViewHome extends Tonic { webview_auto_register_service_workers: false, webview_service_worker_frame: false }, - path: 'pages/account.html', + path: `pages/account.html?dev=${process.env.DEV ? 'true' : 'false'}`, index: 14, closable: true, maximizable: false, @@ -173,7 +173,7 @@ class ViewHome extends Tonic { id="profile-public-key" > - + diff --git a/src/worker.js b/src/worker.js index b46e391..ec3d3d6 100644 --- a/src/worker.js +++ b/src/worker.js @@ -14,6 +14,11 @@ export default async function (req, env, ctx) { const p = path.join(navigatorPath, route.pathname.groups[0]) const params = url.searchParams + const headers = { + 'Content-Type': type || 'text/html', + 'Cache-Control': 'no-cache', + 'Access-Control-Allow-Origin': '*' + } let data = '' @@ -24,6 +29,7 @@ export default async function (req, env, ctx) { data = await res.text() } else if (!res.ok || res.status === 404) { data = '