title: JavaScript not executing in .NET WebBrowser control
body: <p>Two friends of mine have tested a project I have been working on which relies on the use of the WebBrowser control, and have managed to come across a constant scenario in which the WebBrowser control is unable to execute any JavaScript on the contained web page.</p>
  
  <p>For the sake of narrowing it down I created a new Windows Forms project that contains only a WebBrowser control, and tries to navigate to the following page: <a href="http://javatester.org/javascript.html" rel="nofollow noreferrer">http://javatester.org/javascript.html</a></p>
  
  <p>The result on my friends computer was the below (click to enlarge):</p>
  
  <p><a href="https://i.stack.imgur.com/Pn4D3.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pn4D3.jpg" alt="Control render"></a></p>
  
  <p>As you can see, it doesn't render ANYTHING when trying to call the JS specific code, alternatively if you view it in a web browser with JS disabled or enabled, you'll see something.</p>
  
  <p>He exported his registry keys that contain the setting for JavaScript being enabled (see <a href="https://gist.github.com/4699943" rel="nofollow noreferrer">https://gist.github.com/4699943</a>) and the value for 1400 in each of the keys matches the same settings I use, and when I run the program I have no issue.</p>
  
  <p>The code for the entire test project is as follows:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Windows.Forms;
  
  namespace WindowsFormsApplication1
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void Form1_Shown(object sender, EventArgs e)
          {
              this.webBrowser1.Navigate("http://javatester.org/javascript.html");
          }
      }
  }
  </code></pre>
  
  <p>If a new project is created using this code that targets the 4.5 framework (either on my machine or his) it works, however if one is created using 4.0 or lower the above result occurs. I'm not sure if this is a coincidence or if it is indeed something to do with the problem / solution.</p>
  
  <p>It should be noted that if he navigates to this page in Internet Explorer there are no issues, it detects that JavaScript is enabled, this problem solely resides in this test application and the main project that it is a part of.</p>
  
  <p>Any help would be appreciated, I've spent a good two months trying to figure this out and still can't.</p>