pywebview icon indicating copy to clipboard operation
pywebview copied to clipboard

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

Open tedmoorman opened this issue 1 year ago • 6 comments

Specification

  • pywebview version: 5.1
  • operating system: Windows 10
  • web renderer: chromium (I think)

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

  • NO, I am willing to work on this issue myself.

  • NO, I am prepared to support this issue financially.

tedmoorman avatar May 28 '24 19:05 tedmoorman

Are there any errors?

r0x0r avatar May 28 '24 21:05 r0x0r

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

tedmoorman avatar May 29 '24 12:05 tedmoorman

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.

r0x0r avatar May 29 '24 20:05 r0x0r

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?

tedmoorman avatar May 30 '24 12:05 tedmoorman

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

r0x0r avatar Jun 02 '24 20:06 r0x0r

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!

tedmoorman avatar Jun 04 '24 13:06 tedmoorman

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] avatar Jul 05 '24 02:07 github-actions[bot]

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

github-actions[bot] avatar Jul 10 '24 02:07 github-actions[bot]