Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser has black screen when not headless #21

Open
randall-coding opened this issue Jan 14, 2022 · 2 comments
Open

Browser has black screen when not headless #21

randall-coding opened this issue Jan 14, 2022 · 2 comments
Labels
question Further information is requested

Comments

@randall-coding
Copy link

randall-coding commented Jan 14, 2022

I'm turning headless mode off while I debug, but all that is rendered is a black screen. When I run eval I see that the dom is there and can be interacted with for the website, however I can't see anything on the screen.

I've tried looking through the Browser Launcher options but I don't see anything that I think would help. Does anyone have a solution to this?

let playwright = Playwright::initialize().await.unwrap();
playwright.prepare().unwrap();

let chromium = playwright.chromium();
let browser = chromium.launcher().headless(false).launch().await.unwrap();
let context = browser.context_builder().build().await.unwrap();
let page = context.new_page().await.unwrap();
page.goto_builder("https://www.duckduckgo.com").goto().await.unwrap();

ksnip_20220114-120535

About my machine: Running Ubuntu 21.04

@randall-coding randall-coding changed the title Browser has black screen when headless(false) Browser has black screen when not headless Jan 14, 2022
@randall-coding
Copy link
Author

randall-coding commented Jan 17, 2022

I tried firefox also. It does not have the black screen error, but has a different type. It errors out and crashes if I unwrap on the goto.

'called Result::unwrap() on an Err value: Serde(Error("invalid type: map, expected a string", line: 0, column: 0))', src/bin/webview.rs:47:69

This is line 47 allegedly causing the error.
page.goto_builder("https://www.duckduckgo.com").goto().await.unwrap();

@randall-coding
Copy link
Author

randall-coding commented Jan 18, 2022

PARTIAL SOLUTION:

I realized my playwright was outdated because my rust compiler wasn't the latest. I upgraded to the latest version of rustc nightly, and this fixed the issue with firefox but not the black screen issue with chromium.

Upgraded playwright from 0.9 to 0.19. Using rust nightly 1.60

@octaltree octaltree added the question Further information is requested label Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants