Facing javascript errors in webbrowser control with IE 11 installed - javascript

I use a desktop application, an aspx page is loaded through web browser control in my application. IE8 was upgraded to IE11 and I started facing javascript errors with web browser control. The web browser control worked perfectly with IE8.
I have tried options like setting features for my exe - FEATURE_BROWSER_EMULATION set to 8000/8888, FEATURE_USE_LEGACY_JSCRIPT set to 1, FEATURE_BROWSER_MODE set to 8. Also tried with meta tag for compatibility and with app browser file.
I am able to achieve rendering like IE8 but the javascript errors keep coming up.
Upgrading framework to 4.5 is not an option for me now.
Is there any registry setting or application setting that would force the web browser control to run javascript like it did with IE8?

I did it by putting following line below HEAD tag.
<script>window.onerror=function(){return true;}</script>

FEATURE_BROWSER_MODE now seems to be undocumented. As far as I could find out, it used to be the same FEATURE key as FEATURE_BROWSER_EMULATION, but only briefly in IE8 or IE9. I have no idea how it appeared in my registry.
After removing this key my issues with scripting went away. Before I couldn't get the body element of an IHTMLDocument2 pointer.
https://social.technet.microsoft.com/Forums/ie/en-US/dd0bc3ed-806e-419d-8507-2f11b30744b5/change-browser-or-document-mode-for-ie9-using-c?forum=ieitprocurrentver
https://social.msdn.microsoft.com/forums/azure/en-US/0e1e52da-e462-42fd-bc46-567d08225d79/ihtmldocument2getbody-fails-in-chtmlview-for-ie-11?forum=iewebdevelopment

Related

_BROWSER_ has prevented an outdated plugin "Adobe Flash" from running on this site

Update 23/8/17: Link added.
I'm facing the following issue on our webshop:
After updating to WINDOWS 10 1703 our website is loading as usual but after a few sec the following popup message comes up:
'BROWSER' has prevented an outdated plugin "Adobe Flash" from running on this site. It occurs in IE and Chrome as well, although it doesn't have this issue on older versions of Windows or the latest MAC OS, or on mobile browsers.
There were already a couple of things I tried:
Reinstalling flash
Enabling and disabling the preference of HTML over flash and even tried with the local group policies in windows, but the issue still appears.
The 'funniest' part is that I'm not aware of the situation that we have any flash object on the site. When I was scrolling the source code there where just a few instances where I found something related to flash:
a flash player version checker - javascript (inside the client.js on the site)
in the fancybox jquery
Can these trigger this behavior?
Is there anybody who has experienced something similar lately? Is there a workaround to avoid this?
Thanks in advance
I believe that fancyBox is not related to this, unless it is used to display some flash content, but then it would be quite noticeable :)
Quite possible that "flash player version checker" creates some flash object to check for supported version. Try to disable it.

The breakpoint will not currently be hit. No symbols have been loaded

I am struggling with breakPoint issue in VS 2012 for more than hours. I am from eclipse background, there I never heard about such issues.
Problem :
The breakpoint will not currently be hit. No symbols have been loaded
for this document.
I have placed the break point in click action of Jquery.
I found the issue using the IE script debugging., The file loaded was old file., i.e I have modified a lot, but I can see no changes in the one which is loaded in IE. How to fix the bug
What I have Tried :
I know this question is duplicate, but being a newbie to VS and C#., I could not understand the older answers. For example, in this answer, he told to choose Debug -> Windows -> Modules. But I doesn't have Modules under windows in VS 2012. Also even though I read, I could not understand the explanation.
Also I am quite new to term Assemblies and PDB. Though, I located PDB files as he said. But how to open the .pdb file?
Need :
Could anyone explain me the same answer in easier term (with more explanation).
I found this out by accident with my VS2012 and ASP.NET MVC, maybe it can help somebody. I noticed that breakpoints in javascript that's inline in the *.cshtml file like this won't get hit (note that this file is a cshtml file):
But breakpoints in external *.js files will get hit:
Try to add debugger; key word before $.getJSON
Also make sure if you use IE to un-check the disable script debugging
Internet Options> Advanced tab> Under Browsing.
As I think this issue is related to Javascript debugging not C#
This results for me:
In your web application make sure Silverlight and ASP.NET debugger are enabled.
How to get there?
=> Right click on the Web Application => Properties => Web tab. Under Debuggers section make sure Silverlight and ASP.NET are enabled.
Running Visual Studio 2013 or Visual Studio 2015 RC, I've found that to get a breakpoint to work in a .js file I need two things to be true:
I need to start Visual Studio by right-clicking the VS shortcut and select "Run as administrator". (If right-clicking on the Taskbar icon, select the application shortcut icon from the pop-up menu and right-click on that to get a context menu that includes "Run as administrator".)
I need to set Internet Explorer as the default browser that will be opened for the web debugging session. If I choose Chrome or Firefox, the breakpoint doesn't work for me.
After opening and closing VS, rebooting the PC with all with no chance, this workaround worked for me in VS 2012 ( Ver 11.0.50727.1 RTMREL ):
In Project Property Pages, under Start Options, in Debugger section, only ASP.NET was enabled. As soon as I enabled Native Code and SQL Server, that red circle with plus sign inside, enabled again.
No idea why this worked! No active connection in Server Explorer nor using any native code in the project!
I had the same problem. You can use VS2017 to debug JS code this way.
When you set VS to launch the browser (Chrome in my case), it opens a new Chrome window. I was trying to debug the specific code (different URL from the window that opened) in a new tab. So I had the 'The breakpoint will not currently be hit. Breakpoint set but not yet bound' in VS.
I found out that if I opened the new URL in the original tab it suddenly worked. Seems that VS is tied to that particular tab.
Hope this helps.
These are the particulars of my situation: VS 2017 - Mainly C# code with some embedded HTML/JS which I needed to debug, Chrome (Version 68.0.3440), Windows 10
As this is Javascript code, so you need to use a javascript debugger. Generally internet browsers come with a debugger/inspector menu, which allows you to inspect/debug your javascript easily. Such debuggers come with a lot of useful features such as HTTP request/response inspection, browser session/local storage, etc.
Actually there is "Modules" option, but it's enabled only when you are in debug mode.
You can just press Ctrl+D,M combination when you're in debug.
In few words, PDB is a file that contains all debug information about your assebmly, you can not debug an assembly without this file. Assembly is a file that contains precompiled code for exetuion via CLR.
Could you provide a bit more information about your problem. What kind of application you are trying to debug for example?
Also, if you have located you pdb files made EXACTLY for your assembly, you can load it by right-clicking your assembly in modules window and selecting Load Symbols From > Symbol Path
Try deleting all breakpoints and restarting debugging in Visual Studio.

Magento site slows with IE and gives script error

having issues with one of my clients magento frontend. The website works fine woth chrome but slows down when opening in IE( all versions) or FF. while with ff it is still working ok but the major issue is IE. the error I am getting is the "Stop running this script" A script on this page is causing your web browser to run slowly.
There is a video and a jquery flexislider running on that page and I am not sure if the iframe embed of video is causing the error. IF yes what is the best way to display a video on the page.
Any help would be helpful
Thanks
The cause of the problem could be that Magento uses an outdated version of the Prototype javascript library and IE barfs on the old version. You either have to live with it or figure some way to upgrade Prototype. I have seen other messages on how to do that but they all said it was problematic.

How can Javascript cause IE 8 to reload a page in compatibility view?

I'm testing a fairly complex Javascript-based web application in Internet Explorer 8 on Windows Vista. After loading the application, IE is in "standards" browser mode and "IE 8 standards" document mode. While the application is running, IE will sometimes reload the page and display a message saying something like "A display problem with (URL) has caused Internet Explorer to reload the page in compatibility view" (not the exact message, I'm on a non-English version of Vista). After the reload, the browser is in Quirks mode.
Debugging the Javascript code has been an exercise in futility since the problem can't be reliably reproduced or narrowed down, so I'd appreciate any insight into what could cause this behavior.
There must be a problem with the markup you are serving/creating via innerHTML. Here's an article from the IE team which includes details of IE's auto-recovery from markup that is impossible to parse correctly in IE8-standards-mode:
...there are particular code paths within the new layout engine where, should an error occur, the layout process can’t gracefully recover and we’ve kept assertions around these paths... We refined this experience further in the released version of IE8 by recovering layout “hard asserts” using Compatibility View. In other words, we believe that showing a page the way IE7 would have offers a better user experience than showing no content at all.
Note that using innerHTML invokes the HTML parser, so it could trigger this problem even after the page is loaded if fed an HTML string it can't make head nor tail of.
check here ..
basically. per-page, you can add a meta tag
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
or, site-wide add this to header:
X-UA-Compatible: IE=EmulateIE7
Sounds like Automatic Crash Recovery occurring in the renderer itself. That's a bug in IE itself rather than your scripts, so debugging is going to be tough indeed.
Does this happen on all IE8 installs? Is IE8 updated with the latest patches? (Could it be an unreliable third-party extension?)

IE 7 embedded in winform app is freezing the entire winform app

We stumbled on the usual Friday afternoon bug...
We have a .NET 2.0 WinForms app that uses the WebBrowser control (deployed on XP tablet edition, with latest IE 7). At some point in a page, we are hiding a div and setting a textbox value using some JavaScript. At that point, the operation is working (text appears in the textbox), but the complete window is now frozen. Minimizing/maximizing the window does not respond, etc: it appears that windows messages are not being processed anymore.
If I click anywhere outside of this window (taskbar, another open window), the previously frozen window is now working properly. I redo the same operation, locking occurs again. This is systematic and can be reproduced on this particular machine anytime.
We cannot reproduce it internally using a variety of machines.
On the same machine, if I navigate to the same page and perform the same operation directly with IE 7, everything is working fine... very frustrating.
Any idea on what could cause this behaviour? what to check for? Apparently no JavaScript error is thrown by the page.
Thanks for any ideas or pointers
The .NET 2.0 WebBrowser for Windows Forms is buggy; we've ran into so many different bugs in the implementation, including some interop errors that cause crashing AccessViolationExceptions, that we're now moving away from embedded IE and using Mozilla.
I hate to be a pessimist, but the embeddable IE control is just junk.
You might want to look into Mono.WebBrowser control. Same managed programming interface, but is implemented with the Gecko engine from Firefox and an alternate implementation with the WebKit engine from Chrome and Safari.
Another alternative is to skip the .NET 2.0 WebBrowser wrapper and use the ActiveX IE control directly via mshtml interfaces. Unfortunately, there are even a few bugs in the generated mshtml wrapper.
Bottom line: I'd recommend Mono.WebBrowser.

Categories