Bug 5699

Javascript Errors in OLE Control after Update to Powerbuilder 2019 R2 from PB 12.5 13 January, 2021

Steven Green
04 December, 2020
Product: PowerBuilder Category: Controls & UI
Version: 2019 R2 Build: 2353
Classification: Issue Publishing: Public
Priority: P3
Status: Verifying Reason:
Communication Status: Waiting for Customer
armando herrera @Appeon 13 January, 2021
Hi Steven,

I would like to check with you if the response provided has been helpful enough to resolve your case. If so, can we proceed to close the ticket?.
Otherwise, please let us know if we can provide you with any further assistance, remember you can always open another ticket any time you need it.  

Zhao Kai @Appeon 18 December, 2020
Hi Steven,

1) does Appeon know about this ? 
Yes. Appeon knows there are many limitations on OLE-Microsoft web browser, so Appeon provides WebBrowser control to take the place of it. In fact, Microsoft has decided to stop supporting IE and recommends Edge (Chromium) instead. 

2) Is it documented anywhere?
No. But you can find related posts on Appeon community, for example:

3) Has this been addressed in current versions of PB
No. OLE can use any third-party control, not just Microsoft web browser. PB cannot control its behavior, You can seek help on Community or from the third-party control provider.

4) Has Appeon addressed this in their new web browser object
The same as the new Edge, WebBrowser control is based on chromium,  so it won’t have this issue.

5) If we use the new Web Browser appeon object as a replacement to the MS OLE Web Browser does it support javascript , is it using a Microsoft WEB VIEW or some other ?
PowerBuilder 2019 R3 will provide the function to run java script/function on a web page. You can give it a try in PowerBuilder 2019 R3 Beta2.

Here is the link for this PowerBuilder 2019 R3 Beta2:

Steven Green 17 December, 2020
The issue is this
Whenever a new version of PB is released the Microsoft Web Browser OLE control will not work with Javascript UNLESS.

This is applied to the registry
RegistrySet('HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION',ls_exe,ReguLong!, lui_version)

Where ls_exe is the Powerbuilder EXE and or the exe that powerbuilder has built and will run in production
and lui_version is the version of IE (Usually 11000) 

This has been like this for years, and only significant googling has assisted us to determin this

1) does Appeon know about this ? 
2) Is it documented anywhere?
3) Has this been addressed in current versions of PB
4) Has Appeon addressed this in their new web browser object
 5) If we use the new Web Browser appeon object as a replacement to the MS OLE Web Browser does it support
      javascript , is it using a Microsoft WEB VIEW or some other ?

Please advise on all questions as I need clarity on this ?
Zhao Kai @Appeon 09 December, 2020
Hi Steven,

Glad to hear that.

PowerBuilder 2019 R3 will provide the function to run java script/function in a web page. You can give it a try in PowerBuilder 2019 R3 Beta2 which is going to be released this week or next week.

BTW, we just want to mention that as this issue was not caused by a bug or
defect in our product, so the technical support we’ve provided here is
equivalent to what you can get with a premium support ticket and you got this
one for free this time.

Steven Green 09 December, 2020
It appears our app was already setting the registry variable to use IE 11 but when previewing the app by running it via PB 2019 R2 it is running under PB190.exe


Regedit: \HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
ADD: REG_DWORD  PB190.exe  11000
Restart: Powerbuilder
Steven Green 09 December, 2020
Also if we were to use the new Webcontrol based on chrome we would preferably need to be able to do something like this: 


Say for example there is a search field on the webpage that we want to populate using data from our pb app, and after that get the result back out.

Which the new webbrowser control does not appear to have support for?

Any suggestions.
Steven Green 09 December, 2020
Hi Zhao,

For reference we do not need to access fonts.google.com it was just a simple example of a site that throws the error in question. I can see that when using an OLE web browser on 2019 R2 with https://www.javatester.org/javascript.html it works, and it also reports that it is IE 7 like you said. I will do some experimentation and see what happens if I change the Browser Emulation to IE 11. Will let you know the results.

Zhao Kai @Appeon 06 December, 2020
Hi Steven,

Our engineer said that there is no change about OLE Microsoft web browser. Does it work well on PB 2017 R3 on your end? 

As I mentioned before, when I access 'https://fonts.google.com/', I get the same javascript error on PB 12.5, PB 12.6, PB 2017 R3, and PB 20219 R2, and it does not work even on IE. Please make sure 'https://fonts.google.com/' works well on PB 12.5 on your end.

Please provide the information below for more study, thanks.

1 A simple PB 12.5 case which works well with site 'https://fonts.google.com/', including PBL, exe, runtime files.
2 Does PB 12.5 application work well on all machines?
3 The detailed OS version of the machine where PB 12.5 application works well.
4 The screenshot of all tabs on region and language settings on the above machine.

Steven Green 06 December, 2020
The issue is that APpeon has changed the way OLE Web Browsers work between  Version 2017 R3 and 2019 R3
We use the OLE Microsoft web browser in many places in our APPlication and after we rebuild our APP for 2019 R3/R2 we have immediate Javascript errors on every OLE that previously worked which are very difficult to determin what has changed.

Please advise what has been changed with this particular OLE (Microsoft Web Browser) so we can know where to start ?
Zhao Kai @Appeon 04 December, 2020
Hi Steven,

I get the same javascript error in PB 12.5, PB 12.6, PB 2017 R3, PB 20219 R2. Microsoft Web Browser in OLE custom control uses a default browser and it’s  IE 7, which might not support the javascript on site 'https://fonts.google.com/', so the error popped up.

Then I referred to the article below to change the registry, try to make OLE custom control uses IE 11, then I got a blank page without error. Please check if you have set the same settings.

And I get a blank page without error when accessing site 'https://fonts.google.com/' on IE 11 directly. So, no matter how you set it, OLE will not be able to display the site properly. Please use the new WebBrowser control in PB 2019 R2 to display the site 'https://fonts.google.com/' well.

Steven Green 04 December, 2020
scripterror.PNG (7KB)

In 2019 R2 all of a sudden OLE Web Browser can't load any webpage without getting javascript errors, works fine in old version 12.5

*Reproduce Steps:
Insert an OLE Web Browser control on a window, in the constructor etc run this.Object.Navigate("https://fonts.google.com/") 
Run the pb application and you should get a javascript error immediately, any URL with javascript should break

this link states it is a third party issue, but if that was the case then why does it work on 12.5

What has changed and why, what needs to happen for this to work again.
Windows 10
Database Type:
Database Version: