1. Open Floating Document PiP / Docked Coprocessor
Launch the 420×520 always-on-top Document PiP window (in Chromium) or focus the Docked BroadcastChannel pane if PiP is unavailable or framed.
Web Platform Prototype · Edge + Multi-Window State
A persistent floating sidecar built purely with origin-scoped web APIs:
window.documentPictureInPicture hosts an adaptive tool pane,
Navigation API handles same-document route transitions across edge-rendered HTML pages, and
BroadcastChannel synchronizes checklists and pinned notes across windows and tabs.
pip_coprocessor_bus/workspace/specs
In-page helper panels tear down on page navigation, pushing tools into browser extensions. Combining
documentPictureInPicture, BroadcastChannel, the Navigation API, and CSS
@container queries sustains a persistent cross-route companion on a normal web origin.
Navigating across /, /workspace/specs, /workspace/audit, and
/workspace/notes updates the floating Document PiP (or docked) companion immediately without
losing pinned notes, checklist state, or duplicating bus listeners.
User-activation gates on requestWindow(), framed embed restrictions, or unsupported browsers and
mobile viewports force heavy reliance on the docked BroadcastChannel fallback.
Launch the 420×520 always-on-top Document PiP window (in Chromium) or focus the Docked BroadcastChannel pane if PiP is unavailable or framed.
Step across /, /workspace/specs, /workspace/audit, and /workspace/notes via Navigation API or open a second tab to verify live sync.
Pin the first span from the active route and execute a checklist verification, then watch frames arrive in the Wire Inspector below.
Normative runtime constraints for Document Picture-in-Picture, BroadcastChannel, and the Navigation API.
PIN_NOTE frame over pip_coprocessor_bus.
Document Picture-in-Picture requires transient user activation, starts at about:blank on the opener origin, and closes when the opener unloads.
External <link rel='stylesheet'> nodes are cloned into pipWindow.document.head so CSS container queries adapt identically.
BroadcastChannel.postMessage() delivers structured-cloned payloads to every other handle on the same origin and channel name, excluding the sender handle.
Separate channel instances for the host page and the coprocessor pane transmit live state transitions over the browser bus.
NavigateEvent.intercept({ handler }) updates URL and history state without tearing down the opener JavaScript execution context.
Each intercepted route fetches the edge-rendered HTML document, swaps the workspace landmark, and emits ROUTE_SYNC.
Confirm requestWindow() executes only inside a transient user activation handler.
Expected signal: Activation gate enforced
Confirm BroadcastChannel('pip_coprocessor_bus') rejects payloads failing schema validation.
Expected signal: Schema validator enforced
Check event.canIntercept, event.hashChange, and event.downloadRequest before calling intercept().
Expected signal: Navigation guard verified
No notes pinned yet. Pin a document span above or submit a custom note from the Coprocessor pane.
pip_coprocessor_bus)
Initializing BroadcastChannel listener on pip_coprocessor_bus...
{}
GET /api/routes)
Loading /api/routes descriptor...
BroadcastChannel("pip_coprocessor_bus") with a persistent Document PiP window or docked fallback pane styled by CSS Container Queries.
Keeping a persistent companion tool window synchronized across /workspace/* transitions using standard origin-scoped Web APIs instead of a Manifest V3 extension.
// manifest.json + extension service worker
{
"manifest_version": 3,
"permissions": ["sidePanel", "tabs", "storage"],
"host_permissions": ["https://workspace.example/*"],
"background": { "service_worker": "sw.js" }
}
// background/sw.js
chrome.tabs.onUpdated.addListener((tabId, info) => {
if (info.url) chrome.runtime.sendMessage({ tabId, url: info.url });
});
// public/app.js — Document PiP + BroadcastChannel + Navigation API
const hostChannel = new BroadcastChannel("pip_coprocessor_bus");
const pipWin = await window.documentPictureInPicture.requestWindow({
width: 420,
height: 520,
});
copyStylesheetsToPipWindow(pipWin.document);
createCoprocessorPane(pipWin.document, pipWin.document.body, "pip", options);
window.navigation.addEventListener("navigate", (event) => {
const destUrl = new URL(event.destination.url);
const route = getRouteByPath(destUrl.pathname);
if (route && event.canIntercept) {
event.intercept({ handler: () => handleInterceptedRoute(route, destUrl, event.signal) });
}
});
Matches src/worker.ts, public/lib/coprocessor-protocol.js, public/pip-pane.css, and public/app.js.
<!-- 1. Edge-rendered Workspace Shell (src/worker.ts -> renderPageHtml) -->
<link rel="stylesheet" href="/styles.css">
<link rel="stylesheet" href="/pip-pane.css">
<div class="workspace-grid">
<main id="workspace-main" data-route-path="/" data-route-title="Coprocessor Workspace Overview">...</main>
<aside id="docked-coprocessor" class="coprocessor-shell" aria-label="Coprocessor Pane"></aside>
</div>
<script type="module" src="/app.js"></script>
// 2. Protocol Schema & @container Rules (coprocessor-protocol.js + pip-pane.css)
export const CHANNEL_NAME = "pip_coprocessor_bus";
export const VALID_MESSAGE_TYPES = ["ROUTE_SYNC", "PIN_NOTE", "RUN_CHECK", "CLEAR_NOTES", "PING_COPROCESSOR"];
export const VALID_SOURCES = ["host", "pip", "docked", "tab"];
/* public/pip-pane.css */
.coprocessor-root { container: coprocessor / inline-size; display: grid; gap: 0.8rem; padding: 0.95rem; }
.coprocessor-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
@container (max-width: 380px) {
.coprocessor-header, .coprocessor-toolbar { flex-direction: column; align-items: stretch; }
.coprocessor-stats, .coprocessor-check-row, .coprocessor-note-form { grid-template-columns: minmax(0, 1fr); }
}
// public/app.js — Navigation API handler swaps SSR #workspace-main without closing PiP
const response = await fetch(destUrl.pathname, { signal, headers: { "X-Coprocessor-Nav": "navigation-api" } });
const parsedDoc = new DOMParser().parseFromString(await response.text(), "text/html");
const nextMain = parsedDoc.getElementById("workspace-main");
const currentMain = document.getElementById("workspace-main");
if (nextMain && currentMain) {
currentMain.replaceWith(document.importNode(nextMain, true));
}
dispatchFromHost({ type: "ROUTE_SYNC", source: "host", timestamp: Date.now(), path: route.path, navigationMode: "navigation-api" });
Manifest V3 packaging, store review, host permissions, and an extension background service worker just to keep a companion panel alive across origin routes.
Opener-owned documentPictureInPicture.requestWindow() lifecycle, schema validation in validateCoprocessorMessage(), Navigation API DOM swaps, and #docked-coprocessor fallback.
window.documentPictureInPicture is Chromium-only and disallowed inside cross-origin iframes; full reloads close the opener-owned PiP window, so peer tabs rehydrate via localStorage and BroadcastChannel.