[Question] Popup window is not opened in Fullscreen mode
See original GitHub issueContext:
- Playwright Version: v1.2.1
- Operating System: Ubuntu 18.04.5 LTS
- Node.js version: v15.3.0
- Browser: all
Describe the bug
The starting browser is opened in fullscreen successfully. However, the popup window (new page) is not. Here is my code:
const browser = await chromium.launch({
args: ['--start-maximized'],
headless : false, slowMo : 50});
const context = await browser.newContext({viewport : null});
const loginPage = await context.newPage();
await loginPage.goto(myURL.href); //Login Page was opened in Maximized mode (Fullscreen)
// Next step is to click a button on Login Page, and a new page is opened.
await loginPage.click('#nextBtn');
console.log('Get page after a specific action (e.g. clicking a button');
const [overviewPage] = await Promise.all([
context.waitForEvent('page')
]);
await overviewPage.waitForLoadState();
await overviewPage.screenshot({ path: `reportoverview.png` });
console.log('Current window: ' + await overviewPage.title());
Everything works, except the new Popup window is not maximized. I expect that, I already set maximized flag in the context, so the new popup window should be also maximized. Or am I missing something.
Thank you.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to show fullscreen popup window in javascript?
Use screen.availWidth and screen.availHeight to calculate a suitable size for the height and width parameters in window.open(). Although this is likely to ...
Read more >Issue :when I go fullscreen the popup modal is not visible on ...
It implies overwriting the function responsible for opening the full-screen mode. First, create the desired pop-up element and place it ...
Read more >Popup always should be opened in tab on fullscreen mode
If user clicks the opener window while the new popup window is being created or after open, the full screen opener hides the...
Read more >'Pop-up to confirm' window in full screen mode - SAP Community
POP Up window is a type of MODAL Window ( child window ) and it can't be launched in full screen mode. However...
Read more >Web browser opens popups as new tabs when maximized
(On Windows OS both Chrome and Firefox works as expected - they open dialog windows regardless of the browser being maximized or not.)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@louis57 Interesting! I don’t have headful linux ATM to check this, but this definitely doesn’t work on OSX. Here’s the script I try (also please check out inline comments):
Popup dimensions demo
@louis57 one more question: if you run your scenario manually, starting with a maximized browser, is the popup opened maximized as well? If not, then popup is being opened with predefined
width
andheight
.Unless popup has explicit dimensions, context’s
viewport
option will affect all the popups that are opened in the given context. Is there a specific reason you want to use--start-maximized
over thebrowser.newContext({viewport: {width: 2000, height: 1000}})
?@aslushnikov sorry to bother you again.
Yes, there is a reason which I didn’t realize before. My webapp has a footer. If I use
--start-maximized
in the context, then this footer will be shown. If I set the viewport, either (1920,1080) or (2000, 1000), this footer is not shown, I don’t understand why, because the view port is already big enough. When I test manually, the footer is shown in all viewport size.I have a test case to check the footer, but I couldn’t proceed because of this problem. I thought
setViewportSize
solved my problem, but it didn’t.Now this
--start-maximized
works forloginPage
which comes direct fromcontext
. But for popup windowoverviewPage
,--start-maximized
doesn’t apply to it, even thesetViewportSize
doesn’t really help. My goal is to set popup window also maximized, so that the footer is shown.Have you by any chance a solution? Thanks