r0x0r / pywebview

Build GUI for your Python program with JavaScript, HTML, and CSS
https://pywebview.flowrl.com
BSD 3-Clause "New" or "Revised" License
4.52k stars 533 forks source link

getting a blank/empty window when trying to open a webpage #1396

Closed tedmoorman closed 1 week ago

tedmoorman commented 1 month ago

Specification

Description

Used example in simple_browser.py and am getting a blank/empty window. Web page appears with QtWebEngine and with webbrowser. System is an internal network. Glad to try whatever troubleshooting I can on my end.

Practicalities

r0x0r commented 1 month ago

Are there any errors?

tedmoorman commented 1 month ago

Not getting any errors. Tried another web address and was asked for login credentials, whereas webbrowser will open a new tab in an existing browser without asking for login credentials. The particular site that is blank/empty quickly goes from a white background to a gray background upon closer inspection. Attaching screen shot below. pywebview_blank_screen

r0x0r commented 1 month ago

Are you using PyQT? This looks like a known issue, which is solved by disabling sandbox mode in qt.py line 49 for a selected platform.

Other than that, I suggest using Edge Chromium on Windows.

tedmoorman commented 1 month ago

Are you using PyQT? This looks like a known issue, which is solved by disabling sandbox mode in qt.py line 49 for a selected platform.

I have PyQT installed in the environment, but I am not using PyQT in the code. I'm just using the example from simple_browser.py. Would this still be a problem?

I tried some other websites, and I am seeing those display in the browser. So, maybe it's just an issue with the configuration of certain websites?

r0x0r commented 1 month ago

It is a known QT problem with a fix for selected platforms here. Adding your platform there should help. https://github.com/r0x0r/pywebview/blob/99f18d01434773407cc0d32a01678bbc8ae0034e/webview/platforms/qt.py#L49

I recommend using EdgeChromium webview2 over QT on Windows, though

tedmoorman commented 1 month ago

It is a known QT problem with a fix for selected platforms here. Adding your platform there should help.

I added 'windows' as a platform after running QtCore.QSysInfo.productType(), and I still get the white to gray screen.

I recommend using EdgeChromium webview2 over QT on Windows, though

I also tried with webview.start(gui='edgechromium'), and I still get the white to gray screen.

Please let me know if you think of anything else, and thank you for your help!

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 1 week ago

The message to post on the issue when closing it. If none provided, will not comment when closing an issue.