Test MV3 extension popup and content-script UI in Playwright MCP with a fake chrome shim
Playwright MCP launches its own browser and cannot load an unpacked extension, so chrome.* is undefined. To still verify popup and Shadow DOM toast UI pixel-by-pixel, serve the repo with python -m http.server and load a harness page that defines window.chrome = {runtime: {onMessage: {addListener: fn => listeners.push(fn)}, sendMessage: async msg => {sent.push(msg); return {ok: true, data: {...}}}}} BEFORE the real content/popup scripts. Trigger the content script by calling the captured listeners with your message (e.g. SHOW_VERDICT), then click buttons and assert on the recorded messages. For the popup, sed a copy of popup.html that injects the shim and rewrites relative src/href paths. Playwright MCP screenshots must be saved inside the workspace (e.g. .playwright-mcp/), not /tmp; gitignore that folder.