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
"what I have seen is that PowerBuilder seems not to "unload" the CEF Browser Executable"
- I think you're right because sometimes I get
"-7 -- CEF has been initialized, and the current item can only be set before CEF initialization."
when I'm trying to set li_ret = WebBrowserSet("UserAgent", "XXXXX") at the open event in my app.
I think it depends on debugger was previously started but this is just my guess because the issue occurs randomly.
PB2021 1509