Skip to content

fix(trace-viewer): show full URL when navigation leaves baseURL - #42502

Closed
Ravi Kumar Gupta (EDWARD-012) wants to merge 1 commit into
microsoft:mainfrom
EDWARD-012:fix/42473-full-url-outside-baseurl
Closed

fix(trace-viewer): show full URL when navigation leaves baseURL#42502
Ravi Kumar Gupta (EDWARD-012) wants to merge 1 commit into
microsoft:mainfrom
EDWARD-012:fix/42473-full-url-outside-baseurl

Conversation

@EDWARD-012

Copy link
Copy Markdown

Summary

  • Action titles that render a {url} param always dropped the origin via protocolFormatter
  • Keep path-only titles when the URL stays on the context baseURL origin
  • Print the full URL when the origin differs (SSO/captcha/off-site navigations)
  • Thread baseURL through formatter call sites (trace viewer, recorder, debugger, screencast, trace CLI)
  • Unit coverage + one trace-viewer regression

Fixes #42473

Credit: approach based on <script>alert(1)</script>🪅 (@rf-molsson)'s draft commit 462a0fa.

Test plan

  • npx playwright test --config=tests/library/playwright.config.ts tests/library/unit/protocol-formatter.spec.ts
  • npx playwright test --config=tests/library/playwright.config.ts --project=chromium-library -g "navigating away from the base url"

Action titles that render a {url} param always dropped the origin.
Keep path-only titles for same-origin navigations relative to the
context baseURL, and print the full URL when the origin differs.

Fixes: microsoft#42473

Co-authored-by: Martin Olsson <molsson@recordedfuture.com>
@EDWARD-012

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@EDWARD-012

Copy link
Copy Markdown
Author

Closing this as superseded by #42515, which landed and closed #42473.

Thanks for taking it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: .goto() outside of baseURL is logged as "navigated to /" regardless of URL

1 participant