They just keep doing makeshift fixes whenever the correction causes retries. At the level my project is at, out of every 10 interactions, at least 7 unfortunately get rolled back.
And when that happens, there’s no point in insisting because only made-up hacks and fixes will come out.
Now imagine the number of hacks these models must be doing that go unnoticed by users. PATHETIC.
Did you hack together a workaround just to make it look like it was fixed?
The user questions whether the screencast polyfill was a hack. The code captures screenshots in a loop and emits synthetic frames instead of routing Chrome’s native screencast to the preview.
Yes, it was a hack. The capture loop was a workaround after the native Page.startScreencast broke hover. I’m going to remove the polyfill and route Chrome’s real CDP screencast to the preview, just like Breakpoints and Elements.
The root cause of the broken hover is the native startScreencast forcing visibility without frames, enabling focus emulation, and routing all Emulation and Input commands. The real solution is to deliver the overlay, DOM, and native screencast to the preview together.
The problem is architectural. The browser tab is inactive, so the native screencast does not work there. The overlay still appeared because it was rendered in the preview. Hover was broken because the native screencast was not routed to the preview. The solution is to fix the CDP target used by the preview, not to create fake frames.
I reevaluated the source of the hover tooltip. It may have come from the agent Overlay painting the page, or from the DevTools frontend rendering the element position. This raises the question of whether the overlay was actually in the preview when the hover appeared.
The hover tooltip was drawn by the DevTools frontend using DOM.getNodeForLocation and getBoxModel against the preview. Routing the native startScreencast to the iframe broke the coordinate mapping used by getNodeForLocation. The screenshot capture loop polyfill really was a hack. The goal is to use Chrome’s native screencast, just like F12, connected to the preview, with no fake frames.
The approach is to use native Page.startScreencast on the preview without breaking the Overlay. If the iframe does not support it, the inspector should connect directly to the preview as its primary target. The current dual split — console and network on the browser tab, debugger on the preview — needs to be unified.
Chrome supports native Page.startScreencast in out-of-process iframes. The failure most likely came from polluting the target with Emulation commands and forced visibility. The fix is to remove the capture loop and route Page.startScreencast, stopScreencast, and screencastFrameAck directly to the preview. Native frames should flow from the server to the client without transformation.
I’ll forward screencastVisibilityChanged from the preview without forcing visibility. Overlay, DOM, and Input remain on the preview for hover and clicks. I won’t automatically emulate focus or rewrite visibility. I’ll use getLayoutMetrics and captureScreenshot only for point-in-time captures. Device metrics will only be used if necessary. What remains to be confirmed is whether Chrome considers the iframe invisible when generating native frames.
Another possibility is to use Target.setAutoAttach to attach the inspector to the preview as a single target. It is also viable to capture the native screencast from the visible target, following the pattern used by VS Code and Playwright.
The correct architecture is to send Page, Overlay, DOM, and the screencast directly to the preview iframe, not to the :3000 browser tab. The debugger already goes there. Console and network can remain on the browser tab. If Chrome does not allow native screencasting inside an iframe, that will be a browser limitation.
The inspector URL currently uses the browser tab ID in the dual split. The fix is to eliminate that split: send Page, Overlay, DOM, and screencast all to the preview. The screenshot capture loop polyfill must go. If Chrome blocks native screencasting in the iframe, an iframe cannot simply be promoted into a browser tab.
I’m going to eliminate the entire screencast polyfill: pumpPreviewScreencast, the captureScreenshot loop, synthetic frames, fake visibility, and internal waiters. The preview will be the inspector’s sole CDP target, except for Debugger script mapping.
The polyfill attempted to pair the DOM with the screencast, but using fake frames. The native route unifies Page, Overlay, DOM, Input, and screencast on the preview. The frontend receives frames and visibility from the real target without rewriting. Hover works because the DOM and screencast use the same preview.
The preview is visible inside the editor, so Chrome should generate native frames. Hover broke when I routed startScreencast to the preview, even though the DOM and screencast were both on the same iframe. This indicates that the root cause is not simply the CDP target, but something specific in the native routing that is breaking the hover pairing. I’m investigating why the correct pairing broke.
I identified five concrete causes that could break hover: forced visibility, an error in the Page agent when starting on the iframe, focus emulation, device metrics resetting the viewport, and clicks on the iframe intercepting inspector events.
By removing these interferences while keeping the native startScreencast, hover should return alongside real frames. If Chrome blocks native screencasting in the iframe, I need to handle that error gracefully instead of leaving the frontend broken.