[错误]: Chromium no-store 获取流到达 EOF,但请求失败,错误代码为 ERR_ABORTED
作者: etonedu2026创建于 2026年9月16日更新于 2026年9月16日
翻译:
1.63.0 (匹配捆绑的全铬 153.0.8010.12. 同名剧本还以剧作家-核心 1.62.1 / Chromium 151.0.7922.34再现.
- 复制步骤
库:https://GitHub.com/etonedu2026/playwright-no-store-stream-repro 互联网档案馆的存檔,存档日期2011-12-20.
根据账户所有人的政策,存储处必须保持私有;维护者默认无法访问。 我知道模板要求有一个寄存器。 为使本报告在无法查阅的情况下能够独立复制,下文列出完整的合成脚本和确切的依赖性。 它没有应用程序代码或应用程序数据.
在空目录中,以下保存为`package.json':
贾森 { "名":"玩弄-无-店-流-回",". "私人":真实的, "类型":"模块", "德行":{"玩弄-核心":"1.63.0"} {\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢?
将以下保留为`repro.mjs':
{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你来干什么?
从“ node: http” 导入 {创建Server };
从“ playwright- core” 导入{铬} ;
Const 服务器 = 创建Server( (req, res) ) {{
const url = 新的 URL(req.url, “http://localhost");
如果(url.pathname !=============================================================================================
res. write 头 (200, {)
"Content-Type":"应用程序/json",
“缓存控制” : url.searchPrams.get( “缓存” ),
* ;
Res.write('{'ok:');
setTimeout(( ()) QQ Res. end(' true}"), 20;
* ;
等待新的承诺( 解析 QQ server. listen( 0, “ 127. 0.0 1”, 解析 ) );
c. 发源地=`http://127.0.0.1:${server.address (.).port}`;
const浏览器=等待chromium.launch({无头:真,可执行Path:chromium.executablePath ()});
c. 结果=[;];
尝试{
用于[ [ ['no- store',' stream'], ['no- store','json'], ['no- crache',' stream']] 的 (const [cache, reader]) {
用于(let repeat = 0; repeat < 2; repeat ++) {
const上下文 = 等待浏览器. newContext ();
尝试{
const page = 正在等待上下文. newPage ();
等待page.goto(来源);
const match = request QQ新 URL (request.url ()) pathname QQ"/data" ;
Const 终端 = 新承诺( 解析 {{}
页: 1
if (matches( request)) solve({事件:'request finished'});
* ;
page.on ('request failed', request {} 页面 请求失败)
如果( matches( request)) 解决({事件:'request failed',失败:request.failure ()?.errorText });
* ;
* ;
const headers = page. WaitForResponse(回复QQ匹配(response.request ())); ;
Const 应用程序 = page. value(async ({快取,阅读器 }) {{
const答复=等待获取(`/data?cache=${cache}`;
如果(读取QQ'json')返回(等待回复.json ())ok;
const handle = response.body.getReader (); (中文(简体) ).
cont块=[;];
时( 真){
cons {已完成,值}=等待手柄。 改为();
如果(done)中断;
块. push(... 值);
{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}你觉得呢?
handle.releaseLock () (; ).
返回 JSON.parse(新文本Decoder (.decode (新Uint8Array (chunks)))).ok;
,{缓存,
. . . . . . .
内容来源: microsoft/playwright