-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: prevent erroneous new main frame #10549
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
20b5253
to
cde5891
Compare
cde5891
to
7110899
Compare
@OrKoN are the CI failures related to this patch? |
@adamraine did you find a reason why this event is emitted? |
Not yet, planning on doing more investigation today. |
probably not, restarted the failing check. |
Update on investigation, this appears to be coming from a fenced frame (notice the target subtype). Still not sure exactly how this event gets created though. {
"method": "Target.attachedToTarget",
"params": {
"sessionId": "221795A5659470D7AC6FCBF3F311D882",
"targetInfo": {
"targetId": "F5B7345C9BF9413F71A9B51D22304A82",
"type": "iframe",
"title": "",
"url": "",
"attached": true,
"canAccessOpener": false,
"browserContextId": "6310EBC13B0F02CB468081EC10C1A4B0",
"subtype": "fenced"
},
"waitingForDebugger": true
},
"sessionId": "B5668ED04C68E8A4178A04D5EE1EB6E0"
} Frame tree: {
"frame": {
"id": "F5B7345C9BF9413F71A9B51D22304A82",
"loaderId": "4BDF72DDE41DDD533EFDE652EB563B30",
"url": ":",
"domainAndRegistry": "",
"securityOrigin": "://",
"mimeType": "text/html",
"adFrameStatus": {
"adFrameType": "none"
},
"secureContextType": "InsecureScheme",
"crossOriginIsolatedContextType": "NotIsolatedFeatureDisabled",
"gatedAPIFeatures": []
}
} |
@adamraine I believe the event might be created in the same place as for regular frames. The problem seems to be that the fenced frame does not report a parent id. It is probably because it is 'fenced' but for CDP purposes we might need to still report it. Would you mind filing a crbug so that we can discuss? cc @caseq |
For reasons I am still investigating, Chrome will sometimes emit a random
Page.frameNavigated
event that looks like this:The frame ID of this event is not the same frame id as the actual main frame of the tree, however it is set as the main frame since it doesn't have a parent id.
It happens when running Lighthouse in DevTools:
GoogleChrome/lighthouse#15073
This patch ensures that the main frame of a frame tree can only be set one time so this random event does not influence the frame tree.