- Notifications
You must be signed in to change notification settings - Fork4.9k
chore(trace): local network access error message#38221
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
Skn0tt commentedNov 14, 2025
I deployed this to |
Skn0tt commentedNov 14, 2025
Screen.Recording.2025-11-14.at.12.42.02.mov |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
packages/trace-viewer/src/sw/main.ts Outdated
| // Since all our requests go through the service worker, we cannot open the permission prompt for them. | ||
| constlnaPermission=awaitnavigator.permissions.query({name:'local-network-access'asPermissionName}).catch(()=>{}); | ||
| if(lnaPermission&&lnaPermission.state!=='granted') | ||
| message+=`\n\nIf your trace is in a local or private network, please grant Local Network Access in your browser's site settings and reload.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
No such thing on my machine. How do I make things work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
If you're on latest Chrome, you should have it. Everybody else shouldn't see it becauselnaPermission isundefined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I don't see the setting. I can see the warning. How do I make it go away in my Chrome?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Follow the video in#38221 (comment). If you see the warning, you should also see the setting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Ah! Mind giving user a hint via rendering more helpful instructions? I went to the settings and did not find it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Would this be helpful? I worry it's too Chrome-specific.
| message+=`\n\nIf your trace is in a local or private network,please grant Local Network Access in your browser's site settingsand reload.`; | |
| message+=`\n\nIf your trace is in a local or private network,open Site settings via the Settings icon on the left of your navigation bar,andscroll to the bottom to grant the Local Network Access permission. Thenreload the page.`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Skn0tt commentedNov 28, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Turns out that when you don't call Screen.Recording.2025-11-28.at.10.02.46.movThere's no good way of writing a test for this, though. To reproduce it, the trace viewer needs to be hosted on a public IP address, and that's a little hard to do from inside a test. |
Test results for "MCP"2 failed 2608 passed, 116 skipped Mergeworkflow run. |
Test results for "tests 1"12 flaky39451 passed, 784 skipped Mergeworkflow run. |

Closes#38207.
The current implementation of LNA doesn't really allow us to detect violations.
fetchoutside of a service worker automatically prompts for permission, butfetchinside a service worker does not and simply fails with "failed to fetch".Even if we were able to detect it, the only way of obtaining the permission is through issuing a
fetch. But since that always goes through the service worker in our case, and service-worker-initiatedfetchdoesn't prompt the permission, all we can do is ask the user to grant it in site settings.