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
Execute the following C# code, which is using the new headless mode.
It used to work fine with the old headless mode.
usingMicrosoft.Playwright;intwidth=468;intheight=60;varproblematicUrl="https://api.bannerflow.com/preview/731073/10760085/preview?access-token=[access_token_removed]&snapshot=12689920&autoplay=off&preload=false&seek=preload-frame&fadein=false&env=image-generator";varplaywright=awaitPlaywright.CreateAsync();varbrowser=awaitplaywright.Chromium.LaunchAsync(newBrowserTypeLaunchOptions{Channel="chromium",Args=["--headless"]});varpage=awaitbrowser.NewPageAsync(newBrowserNewPageOptions{ScreenSize=newScreenSize{Height=height,Width=width}});// removing the SetViewportSizeAsync call fixes the timeout issueawaitpage.SetViewportSizeAsync(width,height);Console.WriteLine("navigating to url");awaitpage.GotoAsync(problematicUrl);Console.WriteLine("waiting 10 seconds for the page to load");awaitTask.Delay(10000);Console.WriteLine("Taking screenshot (this will timeout in 30s)");_=awaitpage.ScreenshotAsync();Console.WriteLine($"screenshot taken!");awaitpage.CloseAsync();Console.ReadLine();
You accidentally included an API key in your example URL, I removed it for you.
Can you please provide a public reproducible issue? bannerflow.com appears to be down at the current moment, and in any case I cannot access a URL with your API key.
I also need more information about your working environment. It seems you are using Docker. What image are you using, what OS/version?
The provided access-token is valid only for this specific URL, so it's fine to share.
The url works for me, please make sure that you have ad blocker turned off:
Version
1.49.0
Steps to reproduce
Execute the following C# code, which is using the new headless mode.
It used to work fine with the old headless mode.
project file:
Environment
Docker
Expected behavior
Screenshot is taken
Actual behavior
Additional context
Works fine when the call to page.SetViewportSizeAsync(width, height) is removed
The text was updated successfully, but these errors were encountered: