nivekxft opened Day card in magpie web and got "This page stopped
working" with "Failed to read the 'localStorage' property from 'Window':
The document is sandboxed and lacks the 'allow-same-origin' flag", often,
until a refresh. Neither magpie nor Day card's files read storage (grep of
both), so the SecurityError comes from a script put in the frame (an
extension's, on some loads), and pagebridge.js reported it as the page's.
a3900e46f let go of the "Blocked a frame" kind and extension stacks; this
one's message is the storage kind, which foreign() did not match.
foreign() now also lets go of a SecurityError that names storage or
cookies with "sandboxed"/"allow-same-origin" (Chromium) or WebKit's "The
operation is insecure". The page's own errors still break it.
Run (wsl-run, magpie-desktop): plugin-page-foreign-error.test.cjs with two
new cases (localStorage read uncaught, sessionStorage read rejected), both
engines green; red on the old pagebridge.js (storage and storageRejected,
via MAGPIE_BRIDGE). plugin-page and plugin-page-idle: 10 of 10 green in
chromium and webkit. Not confirmed: which script reads the storage (the
reporter gave a screenshot, no stack; extension is inferred). Not tried: a
real extension, Go tests, vet (JS-only change).
onducoder opened Day card in magpie web (0.1.3702) and got "This page
stopped working" with "Failed to read a named property 'origin' from
'Location': Blocked a frame with origin "null" ..." logged as
plugin-day-card.open. magpie and Day card's files never read a window's
location; the error came out of a script in the frame (an extension's
inpage script, or a library probing parent/top) and pagebridge.js
reported every error and rejection in the frame as the page's own.
pagebridge.js now lets go of two kinds: an error whose stack or file
names chrome-/moz-/safari-web-extension://, and a SecurityError of the
"Blocked a frame with origin" (Chromium) / "Sandbox access violation"
(WebKit) kind. The page's own errors still break it.
Not confirmed: the reporter gave no stack, so the extension cause is an
inference; Day card's page (0.2.1) opened, with every background tile
clicked, raises nothing in Chromium. WebKit gives a sandboxed page's
uncaught error only as a bare "Script error." with no error object, so
there only rejections can be told apart.
Run (wsl-run, magpie-desktop): new plugin-page-foreign-error.test.cjs in
chromium and webkit, 3 of 3 green; red on the old pagebridge.js in both
(the exact `parent.location.origin` read, uncaught and as a rejection,
and extension stacks). plugin-page, plugin-page-idle: green. Not tried:
a real extension, Go tests (internal/gui needs webkitgtk on that box),
darwin/windows vet (JS-only change). menu-scroll.test.cjs is 0 of 24
there with the old bridge too, so not from this change; not filed here.