We currently assume that the first resource loaded for a web view in the main frame is the main resource, but we can check the request requester instead.
Pull request: https://github.com/WebKit/WebKit/pull/5895
Committed 256142@main (a3c1630617d2): <https://commits.webkit.org/256142@main> Reviewed commits have been landed. Closing PR #5895 and removing active labels.