PR# 18812 Windows implementation of WEB_BROWSER produces JavaScript Errors

Problem Report Summary
Submitter: finnianr
Category: Other
Priority: Medium
Date: 2014/02/14
Class: Bug
Severity: Non-critical
Number: 18812
Release: 7.2.9.1351
Confidential: No
Status: Analyzed
Responsible:
Environment: Windows 7, SDK 7.1
Synopsis: Windows implementation of WEB_BROWSER produces JavaScript Errors

Description
The Windows implementation of WEB_BROWSER produces JavaScript Errors for a number of websites. For example:

1. http://divination.com/iching/lookup/27-2/
2. http://www.onlineclarity.co.uk/friends/hexresults.php?nr=27

The end user has to click through multiple javascript errors before they can view the site.

The examples given display without error on current standalone browsers such as IE 11 and Firefox 26.0.

Attached is an screenshot of a JavaScript error dialog for one the of the examples.

My application links to 13 web sites in total, so as a statistical sample, 2 errors represents about 15% of web sites.
To Reproduce

										
Problem Report Interactions
From:manus_eiffel    Date:2014/02/16    Download   
This seems a bug on the website. If you load the page with FireFox it is very explicit about the following errors, they are not shown to the user by default:

Timestamp: 2/16/2014 13:51:21
Error: ReferenceError: YAHOO is not defined
Source File: http://www.onlineclarity.co.uk/friends/clientscript/vbulletin_global.js?v=367
Line: 11

Timestamp: 2/16/2014 13:51:21
Error: TypeError: vBulletin is undefined
Source File: http://www.onlineclarity.co.uk/friends/clientscript/vbulletin_menu.js?v=367
Line: 11

Timestamp: 2/16/2014 13:51:21
Error: TypeError: vBulletin is undefined
Source File: http://www.onlineclarity.co.uk/friends/clientscript/vbulletin_global.js?v=367
Line: 11

Timestamp: 2/16/2014 13:51:22
Error: The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer p
....
Output truncated, Click download to get the full message

From:finnianr    Date:2014/02/16    Download   
THE PROBLEM WITH ONLINECLARITY.CO.UK

http://www.onlineclarity.co.uk/friends/hexresults.php?nr=27

I spent a number of hours googling for a solution to this but it is mystifying.
It seems that onlineclarity needs the Yahoo User Interface (YUI) JavaScript library, but I can't find where this library is included. It seems that standalone browsers are some how including this library implicitly. The embedded version is not able to find this library.

Either that, or the standalone browsers are suppressing the script errors, but I don't think this is the case.



From:finnianr    Date:2014/02/15    Download   
I have got one of the problem websites to work by adding the reg entry
myching.exe=Ox2AF8
@ HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION

However this website is still giving problems
http://www.onlineclarity.co.uk/friends/hexresults.php?nr=27
(See attached error dialog )

Trying myching.exe=Ox2AF9 doesn't work either.

The diagnostic website www.whatismybrowser.com, would seem to confirm that it is not running in compatiblity mode with these reg values.

Attachment: Onlineclarity-JavaScript-error.png     Size:10390
From:finnianr    Date:2014/02/15    Status: Analyzed    Download   
I have set the DWORD value to 11001 (0x2AF9) 
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION\myching.exe

however the JavaScript errors are still occurring. I can confirm the browser version is 11 by navigating to www.whatismybrowser.com in my application.

I have also tried the value 11000


BTW A better source of information for setting browser version is this URL (which distinguishes 32 bit and 64 bit programs) 

http://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version

From:manus_eiffel    Date:2014/02/14    Status: Closed    Download   
This is a known issue. We have updated our Windows implementation to include the following documentation from Microsoft:

The manager control ActiveX OLE Internet Browser
More details: See MSDN "IWebBrowser2 Interface"
http://msdn.microsoft.com/en-us/library/aa752127(VS.85).aspx

Have a look at the following page to configure the behavior of the web browser:
http://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx

This will let you configure your application to use the latest version of IE and fix those errorrs you are seeing.

From:finnianr    Date:2014/02/14    Download   
Attachments for problem report #18812

Attachment: JavaScript-error.png     Size:10797