You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Regression]: requestFullscreen() in a popup rejects with "not granted" in 1.65 (Chromium 159) #44288
I investigated this regression on Chromium 159.0.8154.6. Here is the verified root cause and test matrix:
Root Cause
In Chromium 159, the feature flag SuppressFullscreenFromUnfocusedView was enabled by default (crbug.com/347495359, Gerrit 8414088, commit 8d1e242cb).
In content/browser/renderer_host/render_frame_host_impl.cc (RenderFrameHostImpl::EnterFullscreen), Chromium now rejects fullscreen requests if the view lacks window focus, even when transient user activation is present:
constbool missing_focus =
base::FeatureList::IsEnabled(
blink::features::kSuppressFullscreenFromUnfocusedView) &&
!GetView()->HasFocus();
if ((!consumed_activation || missing_focus) && !consumed_token) {
DLOG(ERROR) << "Cannot enter fullscreen without a transient activation...";
std::move(callback).Run(/*granted=*/false);
return;
}
When granted == false, Blink's Fullscreen::DidResolveEnterFullscreenRequest maps this to RequestFullscreenError::kNotGranted, rejecting the JavaScript promise with TypeError: not granted.
Why it triggers in Playwright
In headless Chromium, newly opened popup targets do not receive window manager focus, leaving GetView()->HasFocus() as false.
popup.keyboard.press() dispatches CDP Input.dispatchKeyEvent, which grants transient activation to the renderer but does not set RenderWidgetHostView::HasFocus().
Because missing_focus is true, Chromium denies the fullscreen request.
Confirmed Test Matrix (Chromium 159.0.8154.6)
Scenario
Result (popup)
Default 1.65.1 (repro as written)
[ 'TypeError: not granted', false ]
With await popup.bringToFront()
[ 'ok', true ]
With --disable-features=SuppressFullscreenFromUnfocusedView
[ 'ok', true ]
await popup.bringToFront() resolves it because CDP Page.bringToFront calls WebContentsImpl::Focus() / view_->Focus().
Next Steps / Potential Fix
Since Playwright aims to emulate authentic user actions (where interacting with a popup implies window focus), should Playwright ensure target focus before dispatching user input, or activate/focus popups during initialization?
Happy to contribute a PR for this if the team agrees on the preferred direction!
Thanks — reproduced your matrix on 1.65.1 / Chromium 159.0.8154.6: popup.bringToFront() before the key press and --disable-features=SuppressFullscreenFromUnfocusedView both make the popup's requestFullscreen() succeed. We'll use bringToFront() as a workaround meanwhile; leaving the fix direction to the maintainers.
Issue:requestFullscreen() fails when invoked from a newly opened popup in headless Chromium.
Environment:
Playwright: 1.66.0-next (local source)
Chromium: 159.0.8154.13
Node.js: v26.13.1
OS: Windows
Execution mode: Headless
1. Observation
During investigation, fullscreen behaviour was verified in three scenarios:
Test Case | Scenario | Result
-- | -- | --
TC_001 | Request fullscreen from the main page | Passed
TC_002 | Request fullscreen from a popup without bringing it to the foreground | Failed – TypeError: not granted
TC_003 | Bring the popup to the foreground using bringToFront() and request fullscreen | Passed
The issue is reproducible in the popup scenario, while the main-page fullscreen request works as expected.
The reproduction indicates that keyboard input and transient user activation alone do not guarantee that the popup has the required window focus for fullscreen.
2. Root Cause Analysis
The investigation points to Chromium's SuppressFullscreenFromUnfocusedView behaviour.
In headless Chromium, a newly opened popup may remain an unfocused window. Although Playwright can dispatch keyboard input to the popup, this does not necessarily make the popup the focused browser window.
Consequently, Chromium rejects the Fullscreen API request with:
TypeError: not granted
Calling popup.bringToFront() before requesting fullscreen allows the operation to succeed, indicating that window focus is relevant to the failure.
3. Conclusion
The observed failure is associated with fullscreen requests originating from an unfocused popup in Chromium 159.
The main-page fullscreen scenario succeeds, and the popup scenario succeeds after bringing the popup to the foreground.
Further investigation is required to determine the appropriate Playwright-side handling without introducing unintended focus changes or affecting existing popup behaviour.
4. Current Status
Issue reproduced locally.
Three execution scenarios investigated.
Popup focus behaviour identified as a contributing factor.
Hi, I'm the Playwright bot. I reproduced this on Linux and prepared a fix.
Reproduced in 1.65.1 and current main (aa3c4453c15602f20ccf60c52fde74497e1ac268), in headless Chromium only. Firefox and WebKit pass. Chromium's new fullscreen check requires actual window focus even when Playwright emulates focus. The proposed fix disables SuppressFullscreenFromUnfocusedView for Playwright launches, so fullscreen works without bringing the popup to front or changing focus during input.
The bisect found the commit that enabled the check: Chromium r1715938. 8d1e242cb introduced the check earlier, but left it disabled.
Regression test
Added this case to the existing CA-020 requestFullscreen test, after its main-page fullscreen checks:
Without the fix, the assertion receives TypeError: not granted. With the fix, it passes.
Versions, variations, and checks
All runs were on Linux with Node.js 24.22.3. Stable-version checks used a locally supplied HTML page with a keyboard handler; the main page remained fullscreen when opening the popup, as in the report.
Version / browser
Mode
Default popup
With bringToFront()
With feature disabled
1.64.1 / Chromium 156.0.8078.4
Headless
Pass
Pass
Pass
1.65.1 / Chromium 159.0.8154.6
Headless
TypeError: not granted
Pass
Pass
1.65.1 / Chromium 159.0.8154.6
Headed, Xvfb
Pass
Pass
Pass
Main / Chromium 159.0.8154.13, before fix
Headless
TypeError: not granted
—
—
Main / Chromium 159.0.8154.13, with fix
Headless
Pass
Pass
Pass
Main / Firefox 159.0
Headless
Pass
—
—
Main / WebKit 27.2
Headless
Pass
—
—
The main-page requests passed in every stable-version variation. In the failing 1.65.1 popup, document.hasFocus() still returned true.
After the fix, CA-020 also passed in headed Chromium and WebKit under Xvfb, and in full Chromium's headless mode (PWTEST_CHANNEL=chromium). Headed Firefox retains the test's existing skip.
Good builds: r1706652, r1715169, r1715645, r1715924, r1715933, r1715936.
Bad builds: r1739868, r1723380, r1719394, r1717167, r1716204, r1716081, r1716001, r1715958, r1715941, r1715939, r1715938.
The last good available build is r1715936; the first bad is r1715938.
Validation:
npm run build
xvfb-run -a npm run test -- tests/library/capabilities.spec.ts \
tests/library/emulation-focus.spec.ts tests/page/page-event-popup.spec.ts \
--workers=2 --retries=0 --reporter=line
npm run flint
Results: 162 passed, 6 existing skips; build and all lint/type checks passed. An initial run without a display passed 160 tests and failed only the two Firefox WebGL checks. Those checks passed with a display, including in the final headless run under Xvfb. WebKit initially lacked system libraries; it passed after installing them.
The Chromium regression was checked again with the fix removed and failed with the same error, then passed after restoring the fix.
Hi, I'm the Playwright bot. I prepared a Chromium bug draft with a tested, standalone CDP reproduction.
Chrome Headless Shell 159.0.8154.13 rejects the popup's fullscreen request; full Chrome at the same version passes in both headed and headless modes. The reduced reproduction needs neither Playwright nor focus emulation, and the opener need not be fullscreen. The popup reports document focus and transient user activation in all three modes.
Run the three commands in the script's comments. Headed Chrome needs a display; xvfb-run -a was used on Linux. Compare the printed result.
Problem:
This is a regression between Chrome Headless Shell 156.0.8078.4 and 159.0.8154.13.
In Headless Shell 159.0.8154.13, the result is:
[ 'TypeError: not granted', false, true, true ]
Full Chrome 159.0.8154.13, both headed and with --headless, returns:
[ 'ok', true, true, true ]
The values are the fullscreen promise result, whether a fullscreen element exists, document.hasFocus(), and navigator.userActivation.isActive at the key event. Both browser products report source revision 4d790f9eb4c8abe65b8aaa3feba664e7c734ba56.
Expected: opening and interacting with a popup should allow requestFullscreen() in Headless Shell as it does in headed Chrome. The focused document has transient user activation. This script uses only CDP and Node.js built-ins; it does not emulate focus or request fullscreen in the opener.
The regression boundary was confirmed with the same script: Headless Shell r1715936 passes; r1715938 rejects. Both report version 157.0.8096.0. Commit 031f5860c5fc99aadeb34b55bdc143cbb0359a79, r1715938, enabled SuppressFullscreenFromUnfocusedView. The earlier 8d1e242cb955d87bc84117fcb8010fd6d4119d5e added the browser-view focus check in RenderFrameHostImpl::EnterFullscreen.
Passing --disable-features=SuppressFullscreenFromUnfocusedView makes the same script pass in Headless Shell 159.0.8154.13. In the reproduction that also requests fullscreen in the opener, sending Page.bringToFront to the popup before keyboard input also makes it pass.
An additional CDP reproduction kept the opener fullscreen, as in the original report. Headless Shell 159.0.8154.13 failed both with and without focus emulation; Page.bringToFront and disabling the feature each made it pass. Full Chrome 159.0.8154.13 passed in headed and headless modes. Headless Shell 156.0.8078.4 passed.
This narrows the report to Headless Shell, rather than all headless Chrome. Windows and macOS were not tested in this run. The Chromium form requires a Google sign-in, so the report is a draft, not a filed issue.
Triaged on Linux by the Playwright bot - agent run
Activity
wtfnixin commentedon Nov 22, 2026
I investigated this regression on Chromium 159.0.8154.6. Here is the verified root cause and test matrix:
Root Cause
In Chromium 159, the feature flag
SuppressFullscreenFromUnfocusedViewwas enabled by default (crbug.com/347495359, Gerrit 8414088, commit8d1e242cb).In
content/browser/renderer_host/render_frame_host_impl.cc(RenderFrameHostImpl::EnterFullscreen), Chromium now rejects fullscreen requests if the view lacks window focus, even when transient user activation is present:When
granted == false, Blink'sFullscreen::DidResolveEnterFullscreenRequestmaps this toRequestFullscreenError::kNotGranted, rejecting the JavaScript promise withTypeError: not granted.Why it triggers in Playwright
GetView()->HasFocus()asfalse.popup.keyboard.press()dispatches CDPInput.dispatchKeyEvent, which grants transient activation to the renderer but does not setRenderWidgetHostView::HasFocus().missing_focusistrue, Chromium denies the fullscreen request.Confirmed Test Matrix (Chromium 159.0.8154.6)
popup)[ 'TypeError: not granted', false ]await popup.bringToFront()[ 'ok', true ]--disable-features=SuppressFullscreenFromUnfocusedView[ 'ok', true ]await popup.bringToFront()resolves it because CDPPage.bringToFrontcallsWebContentsImpl::Focus()/view_->Focus().Next Steps / Potential Fix
Since Playwright aims to emulate authentic user actions (where interacting with a popup implies window focus), should Playwright ensure target focus before dispatching user input, or activate/focus popups during initialization?
Happy to contribute a PR for this if the team agrees on the preferred direction!
julien-f commentedon Nov 22, 2026
Thanks — reproduced your matrix on 1.65.1 / Chromium 159.0.8154.6:
popup.bringToFront()before the key press and--disable-features=SuppressFullscreenFromUnfocusedViewboth make the popup'srequestFullscreen()succeed. We'll usebringToFront()as a workaround meanwhile; leaving the fix direction to the maintainers.Archana20235 commentedon Nov 22, 2026
QA Observation – Playwright Issue #44288
Issue:
requestFullscreen()fails when invoked from a newly opened popup in headless Chromium.Environment:
Playwright: 1.66.0-next (local source)
Chromium: 159.0.8154.13
Node.js: v26.13.1
OS: Windows
Execution mode: Headless
1. Observation
During investigation, fullscreen behaviour was verified in three scenarios:
Test Case | Scenario | Result -- | -- | -- TC_001 | Request fullscreen from the main page | Passed TC_002 | Request fullscreen from a popup without bringing it to the foreground | Failed – TypeError: not granted TC_003 | Bring the popup to the foreground using bringToFront() and request fullscreen | PassedThe issue is reproducible in the popup scenario, while the main-page fullscreen request works as expected.
The reproduction indicates that keyboard input and transient user activation alone do not guarantee that the popup has the required window focus for fullscreen.
2. Root Cause Analysis
The investigation points to Chromium's
SuppressFullscreenFromUnfocusedViewbehaviour.In headless Chromium, a newly opened popup may remain an unfocused window. Although Playwright can dispatch keyboard input to the popup, this does not necessarily make the popup the focused browser window.
Consequently, Chromium rejects the Fullscreen API request with:
TypeError: not grantedCalling
popup.bringToFront()before requesting fullscreen allows the operation to succeed, indicating that window focus is relevant to the failure.3. Conclusion
The observed failure is associated with fullscreen requests originating from an unfocused popup in Chromium 159.
The main-page fullscreen scenario succeeds, and the popup scenario succeeds after bringing the popup to the foreground.
Further investigation is required to determine the appropriate Playwright-side handling without introducing unintended focus changes or affecting existing popup behaviour.
4. Current Status
Issue reproduced locally.
Three execution scenarios investigated.
Popup focus behaviour identified as a contributing factor.
Regression test implementation pending.
Permanent code fix pending.
Full regression validation pending.
microsoft-playwright-automation commentedon Nov 23, 2026
microsoft-playwright-automation commentedon Nov 23, 2026
Hi, I'm the Playwright bot. I reproduced this on Linux and prepared a fix.
Reproduced in 1.65.1 and current main (
aa3c4453c15602f20ccf60c52fde74497e1ac268), in headless Chromium only. Firefox and WebKit pass. Chromium's new fullscreen check requires actual window focus even when Playwright emulates focus. The proposed fix disablesSuppressFullscreenFromUnfocusedViewfor Playwright launches, so fullscreen works without bringing the popup to front or changing focus during input.The bisect found the commit that enabled the check: Chromium r1715938. 8d1e242cb introduced the check earlier, but left it disabled.
Regression test
Added this case to the existing
CA-020 requestFullscreentest, after its main-page fullscreen checks:Without the fix, the assertion receives
TypeError: not granted. With the fix, it passes.Versions, variations, and checks
All runs were on Linux with Node.js 24.22.3. Stable-version checks used a locally supplied HTML page with a keyboard handler; the main page remained fullscreen when opening the popup, as in the report.
bringToFront()TypeError: not grantedTypeError: not grantedThe main-page requests passed in every stable-version variation. In the failing 1.65.1 popup,
document.hasFocus()still returnedtrue.After the fix,
CA-020also passed in headed Chromium and WebKit under Xvfb, and in full Chromium's headless mode (PWTEST_CHANNEL=chromium). Headed Firefox retains the test's existing skip.Bisect command:
node utils/bisect-chromium.mjs --good 156.0.8078.4 --bad 159.0.8154.6 \ --check 'npm run ctest -- tests/library/capabilities.spec.ts --grep CA-020 --workers=1 --retries=0 --reporter=line'Good builds: r1706652, r1715169, r1715645, r1715924, r1715933, r1715936.
Bad builds: r1739868, r1723380, r1719394, r1717167, r1716204, r1716081, r1716001, r1715958, r1715941, r1715939, r1715938.
The last good available build is r1715936; the first bad is r1715938.
Validation:
npm run build xvfb-run -a npm run test -- tests/library/capabilities.spec.ts \ tests/library/emulation-focus.spec.ts tests/page/page-event-popup.spec.ts \ --workers=2 --retries=0 --reporter=line npm run flintResults: 162 passed, 6 existing skips; build and all lint/type checks passed. An initial run without a display passed 160 tests and failed only the two Firefox WebGL checks. Those checks passed with a display, including in the final headless run under Xvfb. WebKit initially lacked system libraries; it passed after installing them.
The Chromium regression was checked again with the fix removed and failed with the same error, then passed after restoring the fix.
Draft PR: #44315
Triaged on Linux by the Playwright bot - agent run
dgozman commentedon Nov 24, 2026
Agent, let's also prepare a crbug draft, focusing on headless behavior diverging from headed. I think chromium headless should align with headed here.
microsoft-playwright-automation commentedon Nov 24, 2026
microsoft-playwright-automation commentedon Nov 24, 2026
Hi, I'm the Playwright bot. I prepared a Chromium bug draft with a tested, standalone CDP reproduction.
Chrome Headless Shell 159.0.8154.13 rejects the popup's fullscreen request; full Chrome at the same version passes in both headed and headless modes. The reduced reproduction needs neither Playwright nor focus emulation, and the opener need not be fullscreen. The popup reports document focus and transient user activation in all three modes.
The draft below is ready to copy into https://crbug.com/new. The existing draft PR, #44315, is unchanged.
Chromium bug draft
Category: Developer Tools
Operating System: Linux
Channel: Not sure
Chrome version: 159.0.8154.13
Summary: Chrome Headless Shell rejects popup requestFullscreen() while headed Chrome allows it
Steps to reproduce:
fullscreen-repro.mjs:xvfb-run -awas used on Linux. Compare the printed result.Problem:
This is a regression between Chrome Headless Shell 156.0.8078.4 and 159.0.8154.13.
In Headless Shell 159.0.8154.13, the result is:
Full Chrome 159.0.8154.13, both headed and with
--headless, returns:The values are the fullscreen promise result, whether a fullscreen element exists,
document.hasFocus(), andnavigator.userActivation.isActiveat the key event. Both browser products report source revision4d790f9eb4c8abe65b8aaa3feba664e7c734ba56.Expected: opening and interacting with a popup should allow
requestFullscreen()in Headless Shell as it does in headed Chrome. The focused document has transient user activation. This script uses only CDP and Node.js built-ins; it does not emulate focus or request fullscreen in the opener.The regression boundary was confirmed with the same script: Headless Shell r1715936 passes; r1715938 rejects. Both report version 157.0.8096.0. Commit 031f5860c5fc99aadeb34b55bdc143cbb0359a79, r1715938, enabled
SuppressFullscreenFromUnfocusedView. The earlier 8d1e242cb955d87bc84117fcb8010fd6d4119d5e added the browser-view focus check inRenderFrameHostImpl::EnterFullscreen.Passing
--disable-features=SuppressFullscreenFromUnfocusedViewmakes the same script pass in Headless Shell 159.0.8154.13. In the reproduction that also requests fullscreen in the opener, sendingPage.bringToFrontto the popup before keyboard input also makes it pass.Found in #44288.
Did this work before? Yes
Send a Chrome feedback report: No
Checks in this run
All checks ran on Linux with Node.js 24.22.3, without Playwright. The standalone script above produced:
TypeError: not grantedTypeError: not grantedAn additional CDP reproduction kept the opener fullscreen, as in the original report. Headless Shell 159.0.8154.13 failed both with and without focus emulation;
Page.bringToFrontand disabling the feature each made it pass. Full Chrome 159.0.8154.13 passed in headed and headless modes. Headless Shell 156.0.8078.4 passed.This narrows the report to Headless Shell, rather than all headless Chrome. Windows and macOS were not tested in this run. The Chromium form requires a Google sign-in, so the report is a draft, not a filed issue.
Triaged on Linux by the Playwright bot - agent run
fix(chromium): allow fullscreen with emulated popup focus