Repository navigation
fix: take over Plex Web opened over plain http on a LAN address - #7
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
用户影响
以
http://<局域网地址>:32400/web打开 Plex Web 时,播放需要扩展接管的片源会报「s1002 (网络)」。同一片源用https://app.plex.tv打开可以正常播放。这种页面不是安全上下文,页面和内容脚本里都没有
crypto.randomUUID。扩展在生成接管通知编号、原生会话编号和取流 Worker 的 nonce 时调用它,直接抛异常,接管在发出第一次 control-v1 请求之前就中断了。媒体服务已经返回接管描述,播放器却收到空的 204,于是报网络错误。改动
@shimweave/contracts新增randomId(),用crypto.getRandomValues生成 v4 UUID 格式的标识,在安全与非安全上下文里走同一条路径。plex-native-host、native-hook、media-worker-client和extension-worker-bridge。后台 Service Worker 始终是安全上下文,保持不变。验证
pnpm build、pnpm typecheck、pnpm lint、pnpm test(375 个)全部通过。新增randomId在没有randomUUID时的测试,Worker 桥接测试改为只提供getRandomValues。isSecureContext=false、crypto.randomUUID为 undefined,getRandomValues、MediaSource、mediaCapabilities可用。http://<局域网地址>:32400/web,播放一个 STRM(HEVC Main 10)。🤖 Generated with Claude Code