Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Skn0tt wants to merge1 commit intomicrosoft:main
base:main
Choose a base branch
Loading
fromSkn0tt:lna

Conversation

@Skn0tt
Copy link
Member

Closes#38207.

The current implementation of LNA doesn't really allow us to detect violations.fetch outside of a service worker automatically prompts for permission, butfetch inside 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 afetch. But since that always goes through the service worker in our case, and service-worker-initiatedfetch doesn't prompt the permission, all we can do is ask the user to grant it in site settings.

@Skn0ttSkn0tt requested a review fromdgozmanNovember 14, 2025 11:30
@Skn0ttSkn0tt self-assigned thisNov 14, 2025
@Skn0tt
Copy link
MemberAuthor

I deployed this tohttps://pw-trace-lna.netlify.app for manual testing. If you want to try it out, runnpx serve -C inexamples/todomvc and go tohttps://pw-trace-lna.netlify.app/?trace=http://localhost:3000/test-results/adding-new-todos-add-multi-640aa-s-should-add-multiple-todos-chromium/trace.zip

@Skn0tt
Copy link
MemberAuthor

Screen.Recording.2025-11-14.at.12.42.02.mov

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

// 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.`;
Copy link
Member

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?

Copy link
MemberAuthor

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.

Copy link
Member

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?

Copy link
MemberAuthor

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.

Copy link
Member

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.

Copy link
MemberAuthor

@Skn0ttSkn0ttNov 25, 2025
edited
Loading

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.

Suggested change
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.`;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why doesn't it work as advertised? Maybe because we are fetching from the service worker? Should we file an issue with Chrome or fetch from the page?

image

@Skn0tt
Copy link
MemberAuthor

Skn0tt commentedNov 28, 2025
edited
Loading

Turns out that when you don't callrespondWith in the service worker, then Chrome does open the prompt and everything works great:

Screen.Recording.2025-11-28.at.10.02.46.mov

There'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.

@github-actions
Copy link
Contributor

Test results for "MCP"

2 failed
❌ [webkit] › mcp/launch.spec.ts:80 › persistent context@mcp-ubuntu-latest
❌ [webkit] › mcp/seed-default-project.spec.ts:67 › seed test runs in first top-level project with dependencies@mcp-ubuntu-latest

2608 passed, 116 skipped


Mergeworkflow run.

@github-actions
Copy link
Contributor

Test results for "tests 1"

12 flaky⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:1079 › cli codegen › should not throw csp directive violation errors `@firefox-ubuntu-22.04-node18`
⚠️ [firefox-page] › page/page-event-request.spec.ts:182 › should return response body when Cross-Origin-Opener-Policy is set `@firefox-ubuntu-22.04-node18`
⚠️ [playwright-test] › runner.spec.ts:124 › should ignore subprocess creation error because of SIGINT `@macos-latest-node18-2`
⚠️ [installation tests] › playwright-packages-install-behavior.spec.ts:68 › playwright should work `@package-installations-macos-latest`
⚠️ [webkit-library] › library/browsercontext-reuse.spec.ts:250 › reuse launch › should ignore binding from beforeunload `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/proxy.spec.ts:93 › should proxy local network requests › by default › loopback address `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-library] › library/trace-viewer.spec.ts:1351 › should pick locator in iframe `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-filechooser.spec.ts:24 › should upload multiple large files `@webkit-ubuntu-22.04-node18`
⚠️ [webkit-page] › page/page-set-input-files.spec.ts:130 › should upload a file after popup `@webkit-ubuntu-22.04-node18`
⚠️ [playwright-test] › ui-mode-test-attachments.spec.ts:61 › should contain binary attachment `@windows-latest-node18-2`
⚠️ [playwright-test] › ui-mode-test-attachments.spec.ts:81 › should contain string attachment `@windows-latest-node18-2`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:659 › should indicate current test status `@windows-latest-node18-2`

39451 passed, 784 skipped


Mergeworkflow run.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dgozmandgozmanAwaiting requested review from dgozman

@pavelfeldmanpavelfeldmanAwaiting requested review from pavelfeldman

At least 1 approving review is required to merge this pull request.

Assignees

@Skn0ttSkn0tt

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Bug]: Official trace-viewer (trace.playwright.dev) now refusing to load traces on local network

2 participants

@Skn0tt@pavelfeldman

[8]ページ先頭

©2009-2025 Movatter.jp