From e81cdbd9b31a62227698bd3d824fd901551061f0 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Tue, 11 Aug 2026 06:33:46 +0900 Subject: [PATCH 01/10] test(mv3): require content-script isolated-world proof --- tests/test_mv3_isolated_world_contract.py | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/test_mv3_isolated_world_contract.py diff --git a/tests/test_mv3_isolated_world_contract.py b/tests/test_mv3_isolated_world_contract.py new file mode 100644 index 000000000..15a36bece --- /dev/null +++ b/tests/test_mv3_isolated_world_contract.py @@ -0,0 +1,44 @@ +"""Fail-first contract for real Manifest V3 content-script isolated-world evidence.""" + +from __future__ import annotations + +import pathlib +import unittest + +ROOT = pathlib.Path(__file__).resolve().parents[1] +FIXTURE = ROOT / "tests" / "fixtures" / "mv3_basic" + + +class ManifestV3IsolatedWorldContractTests(unittest.TestCase): + """Require content-script compatibility to prove main/isolated world separation.""" + + def test_page_continuously_exposes_its_main_world_sentinel(self) -> None: + """The page must re-read its own window after the content script runs.""" + + page = (FIXTURE / "page.html").read_text(encoding="utf-8") + for expected in ( + 'window.originweaveWorldSentinel = "page"', + "originweavePageWorld", + "setInterval", + ): + with self.subTest(expected=expected): + self.assertIn(expected, page) + + def test_content_ready_depends_on_isolated_world_separation(self) -> None: + """The existing content-script gate must fail if page and extension worlds collapse.""" + + content = (FIXTURE / "content_script.js").read_text(encoding="utf-8") + for expected in ( + 'window.originweaveWorldSentinel = "extension"', + "originweavePageWorld", + 'window.originweaveWorldSentinel === "extension"', + 'pageWorldSentinel === "page"', + ): + with self.subTest(expected=expected): + self.assertIn(expected, content) + self.assertIn("setTimeout", content) + self.assertIn("originweaveContentScript", content) + + +if __name__ == "__main__": + unittest.main() From b2d2324f06f18efdd2547b04adc38703aa5d4e47 Mon Sep 17 00:00:00 2001 From: Seongho Bae Date: Tue, 11 Aug 2026 06:35:46 +0900 Subject: [PATCH 02/10] feat(mv3): publish main-world isolation sentinel --- tests/fixtures/mv3_basic/page.html | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/fixtures/mv3_basic/page.html b/tests/fixtures/mv3_basic/page.html index cc224cff0..ef4f2bb7a 100644 --- a/tests/fixtures/mv3_basic/page.html +++ b/tests/fixtures/mv3_basic/page.html @@ -12,6 +12,14 @@

OriginWeave MV3 compatibility fixture