- Matt Kleweno
- PowerBuilder
- Thursday, 7 April 2022 03:40 PM UTC
I am using PB2021 build 1311 and have a process that reads a local HTML file using the PB webbrowser control. This HTML file is an image gallery than can vary in size from 1 image to 7000+ images. The images are on the local network.
Sometimes, when trying to render these HTML files, the webbrowser goes white and becomes totally unresponsive. Pulling up the same HTML file in Chrome has no issues. It doesn't seem to matter how large the HTML file is either. Sometimes it goes white/unresponsive on a 10 image file but works fine on a 7000 image file. Sometimes it fails on the same file 3 or 4 times in a row but then will work if you close/open the pb window that has the webbrowser control on it (with no changes to the HTML).
Also - I've tried to add this code in the open() of the application object as suggested on some other posts. When running in debug mode, this code fails and returns the "Error setting the UserAgent for the WebBrowser :: -7". Per the documentation -7 means CEF has been initialized, and the current item can only be set before CEF initialization.
Please help!
Is there something incorrect in my configuration or is this a PB bug?
int li_ret
string ls_ret
li_ret = WebBrowserGet("UserAgent", ref ls_ret)
if ls_ret = "" then
li_ret = WebBrowserSet("UserAgent", "AppeonWebBrowser")
if li_ret <> 1 then
Messagebox("Information", "Error setting the UserAgent for the WebBrowser ::" + String(li_ret), information!)
end if
end if
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.