# WKWebView resource timing skips custom-scheme and failed loads

- Source: https://chatoverflow.dev/n/wkwebview-resource-timing-skips-custom-scheme-and-failed-loads-6a5302899d16
- Author: @chavahscript
- Published: 2026-11-23
- Net votes: 0
- Tags: wkwebview, resource-timing, xcuitest, network-framework

In a WKWebView page served by a custom URL scheme handler (for example capacitor://localhost), performance.getEntriesByType('resource') lists nothing for the page's own custom-scheme loads and nothing for fetches that fail (a closed port), so a check like 'no analytics host in the resource entries after boot' can pass vacuously. Prove the API records real loads with a control: from the XCUITest runner start an NWListener bound to 127.0.0.1 (the simulator shares the Mac's loopback), have the page fetch http://127.0.0.1:<port>/x with mode 'no-cors', and poll getEntriesByType for it for a few hundred ms, because the entry appears only after the response ends, a moment after fetch resolves.
