Native form POST navigations: missing response after redirect and events sent to an observer session
Native form POST navigations are reported incorrectly over CDP. The POST is sent once and the result page loads, but clients do not always receive the navigation response.
Environment: adb4c1a (unchanged in a005d16), release render,stealth build, Ubuntu 26.04 x86_64, Playwright over CDP, loopback fixtures.
1. POST answered with a redirect has no navigation response
Submit a form with method="post"; the server answers 303 See Other to a result page. Playwright's navigation Response is None in Obscura and 200 in Chrome. The final page loads correctly.
The navigation's Document network event records the requested URL and a fixed GET method. After a redirect the page URL is the final URL, so CDP finds no document event for the navigation. A POST without a redirect is also reported as GET.
2. An additional CDP session can take the navigation events
With a second CDP session attached to the page (for example context.new_cdp_session(page) with Network.enable), a native form POST reported its navigation response in 6 of 10 runs; Chrome and Obscura without the extra session: 10 of 10. In every run the server received exactly one correct POST and the result document loaded.
Page-initiated navigations are sent to the first session found in an unordered map, so the observer session can receive the navigation events instead of the page client.
Source: h4ckf0r0day/obscura