Let the app run under a panel page's document base

A panel page loads the app with <base> pointing at the app's server, so
addresses the app builds resolve against the document base instead of
the page location, and hash updates stay on the page's own address.
The dev server answers panel origins with CORS on the API routes too.
This commit is contained in:
Sameh Khamis committed 2026-10-02 15:21:37 -07:00
1 parent 63341b947e
commit d9ecd126c8
10 files changed
+96 -11

No files matched your search

+2 -2
View File
@@ -34,8 +34,8 @@ function assertClaimsBefore(block, mutation, label) {
function makeManager(hash = '') {
globalThis.window = { location: { hash, href: `http://localhost/${hash}` } };
globalThis.history = {
replaceState(_state, _title, nextHash) {
window.location.hash = nextHash;
replaceState(_state, _title, next) {
window.location.hash = new URL(next, window.location.href).hash;
},
};
const viewer = {