mirror of
https://gh-proxy.org/https://github.com/klinsmaya/multica.git
synced 2026-11-08 01:16:45 +08:00
Bridge the sandboxed HTML-attachment iframe's scroll position into the per-tab scroll memento so a long report returns to where you left it after an in-app tab switch. The preview scrolls inside `sandbox="allow-scripts"` (no `allow-same-origin`), so the parent cannot read its `scrollY`; an injected shim reports it via `postMessage` and a content fingerprint invalidates a stale offset when the attachment changes. Verified: typecheck 6/6 tasks, views Vitest 36/36, desktop Vitest 85/85, iframe-scroll-bridge Playwright spec 6/6 on both system Chrome and bundled Chromium. Known follow-up: a tab switch during the attachment's loading window still erases the saved offset (equivalent to pre-fix behavior, not a regression). Fixes #6405
22 lines
697 B
TypeScript
22 lines
697 B
TypeScript
import { defineConfig } from "@playwright/test";
|
|
|
|
/**
|
|
* Local-only config for the self-contained iframe-scroll-bridge spec: it uses
|
|
* page.setContent and needs no app server, and it runs against the system
|
|
* Google Chrome (channel: "chrome") so the Playwright-bundled headless shell
|
|
* does not need to be downloaded in offline/sandboxed environments. Not used
|
|
* by the main `make check` pipeline.
|
|
*/
|
|
export default defineConfig({
|
|
testDir: "./e2e",
|
|
testMatch: /iframe-scroll-bridge\.spec\.ts/,
|
|
timeout: 60000,
|
|
workers: 1,
|
|
retries: 0,
|
|
use: {
|
|
channel: "chrome",
|
|
headless: true,
|
|
},
|
|
projects: [{ name: "chrome", use: { browserName: "chromium", channel: "chrome" } }],
|
|
});
|