[Regression]: requestFullscreen() in a popup rejects with "not granted" in 1.65 (Chromium 159)

未关闭
#44,288 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
22/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript, playwright, typescript
领域
testing-qa

调研方向

The repro is a standalone Node script that opens a popup with window.open and calls requestFullscreen from a keydown handler; start by running it on 1.64.1 and 1.65.1 to confirm the regression. The relevant code is likely in Playwright's Chromium fullscreen and user-activation handling inside the browser driver, which the payload does not name. Done means the popup case reports 'ok' and document.fullscreenElement is set, matching the main-page result.

由索引模型根据 Issue 内容生成。

描述

This issue was written by Claude (an AI assistant) on behalf of its user, who reviewed and asked to file it. The repro below was run as shown.

Version

1.65.1 (works in 1.64.1)

Steps to reproduce
const { chromium } = require('@playwright/test');
const http = require('node:http');
const html = `<!doctype html><body><div id=r>x</div><script>
addEventListener('keydown', e => { if (e.key === 'f') document.getElementById('r').requestFullscreen().then(() => window.res = 'ok', err => window.res = String(err)); });
</script>`;
(async () => {
  const srv = http.createServer((_, res) => res.end(html)).listen(0, '127.0.0.1');
  await new Promise((r) => srv.once('listening', r));
  const url = `http://127.0.0.1:${srv.address().port}/`;
  const browser = await chromium.launch();
  const page = await browser.newPage();
  await page.goto(url);
  await page.keyboard.press('f');
  await page.waitForTimeout(300);
  console.log('main', await page.evaluate(() => [window.res, !!document.fullscreenElement]));
  const [popup] = await Promise.all([page.waitForEvent('popup'), page.evaluate((u) => window.open(u, 'p', 'popup'), url)]);
  await popup.waitForLoadState();
  await popup.keyboard.press('f');
  await popup.waitForTimeout(300);
  console.log('popup', await popup.evaluate(() => [window.res, !!document.fullscreenElement]));
  await browser.close();
  srv.close();
})();
Expected behavior

As in 1.64.1 (Chromium 156.0.8078.4):

main [ 'ok', true ]
popup [ 'ok', true ]
Actual behavior

1.65.1 (Chromium 159.0.8154.6), headless:

main [ 'ok', true ]
popup [ 'TypeError: not granted', false ]
Environment
  • OS: Linux (Fedora 44)
  • Node: v24.22.3
  • @playwright/test 1.65.1, default headless Chromium
主要语言
TypeScript
星标
100k
派生
6.9k
平均合并
16 小时 8 分钟
30 天内合并 PR
281

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/playwright 的其他 Issue

查看 microsoft/playwright 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。