Hi, I'm having a small issue with the browser control in PB2019R3 (Build 2728). I think it might be a bug, but wanted to check if there is any way around it.
We use the browser control to display local files, so we navigate using a windows filepath. If the filename contains a # character the file isn't found.
E.g. If I use this command:
wb_browser.Navigate('C:\temp\Invoice#1.pdf')
The browser control displays the error:
Page failed to load.
URL:file:///C:/temp/Invoice#1.pdf
Error: File not found. (-6)
If I do a similar thing in Chrome (or Edge or Firefox) and navigate to a local filepath, it will automatically urlencode it and use the file:// protocol. Is the browser control able to do a similar thing?
e.g. at the moment I navigate to
C:\temp\Invoice#1.pdf
and the browser control tries (and fails) to display
But if I do the same thing from Chrome the browser will display
file:///C:/temp/Invoice%231.pdf
i.e. it urlencodes the # character in the filepath.
The user interface in Chrome and Edge (and Firefox as well as others) handles the URLEncode'ing before handing the URL off to the content retrieval part of the browser. Since the PB Web Browser control does not supply a navigation "single-line edit" control, you'll need to perform this encoding. This sounds like an excellent enhancement request, by the way.