fix(browser): accept localhost and dotted hosts with ports - #1121
Merged
Merged
Conversation
The browser treated localhost:3000 and dotted hosts with ports as custom schemes, rejecting common preview addresses. Recognize those host and port forms before applying the existing HTTP(S) allowlist. Cover normalization and the BrowserPane navigation path while preserving unsupported scheme rejection. Sync the browser UX and E2E scenario.
yuxino
marked this pull request as draft
September 26, 2026 18:58
The published draft branch predates the current upstream base. Integrate it without rewriting the shared branch so the pull request remains current and mergeable.
The browser URL contract and E2E scenario have Chinese counterparts. Keep those counterparts aligned with the address-input behavior documented in the fix, including localhost paths and dotted hosts with ports.
Bring the browser fix branch onto the current integration base before PR validation.
yuxino
marked this pull request as ready for review
September 27, 2026 06:07
Owner
|
已独立核对并合并。#1121 在 |
This was referenced Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与修复
地址栏把
localhost:3000、localhost:3000/index.html和example.com:8080误判为自定义 scheme,主进程因此拒绝导航。现在仅把localhost或点分主机名加数字端口识别为省略协议的 HTTP 地址;file:、javascript:和其他不支持的 scheme 仍走原有拒绝路径。同步更新了resolveLocalFile()注释、中英文浏览器规格和 E2E-059 场景。验证
BrowserPane.navigateAndWait()用户路径。3888b11ab(目标主线b14caaabe):pnpm build:js、桌面typecheck、pnpm lint、pnpm docs:check、pnpm check:pr-base和pnpm test:e2e:boot通过。verify:ui:*。真实桌面录屏
同一本地页面:修复前输入
localhost:3000失败,修复后自动补全为http://localhost:3000/并加载。1920×1080 录屏来自两份独立数据目录的真实 PI-Desktop 窗口;等比缩放并用中性边框补足画幅,只裁掉操作前后的等待。视频拍摄于修复提交978015a47;其后合入的主线未改浏览器导航代码,最新候选已通过上述检查。issue-1095-before-after-1920x1080.mp4
Refs #1095