1

Currently in vb6 project with WebBrowser i am facing a problem. I want to show adsense ad in my app so i create a html page and put the file in server(adsense approved) and I tried to navigate the page from vb6 project with WebBrowser. but everytime its showing some script error. What to do to fix it? please help

Swister
  • 63
  • 7

2 Answers2

2

The problem is probably because the Browser Control runs in document mode 7, so it's essentially emulating IE 7. You can override that with registry entries, but those need to be made on a per application (appname.exe) basis.

A better solution usually is to include the document mode meta tag in your html: <meta http-equiv="X-UA-Compatible" content="IE=edge">.

SO question with an extensive answer descriptions on that meta tag: What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?

MarkL
  • 1,633
  • 1
  • 11
  • 20
-1

Point 1: The WebBrowser control in VB (and later Visual Studio) is not a fully functioning browser like we expect from Chrome, IE, Firefox etc. It has severe limitations.

Point 2: I doubt very much that VB6 has any knowledge of AdSense.

  • You would probably be better off using VB6 to launch the default browser on the user's computer with relevant parameters and let it deal with whatever page you throw at it.

  • You would probably be better off at least moving to VB 2008 - there are problems with conversion, but they are do-able and from VB 2008 you can easily move on eventually to more modern variants.

Tony Duffill
  • 219
  • 1
  • 5
  • 2
    This is incorrect. The browser control _is_ IE. See https://msdn.microsoft.com/en-us/library/aa741313%28v=vs.85%29.aspx. The problem is probably that with the browser control, the document mode defaults to 7, so it is pretty much emulating IE 7. – MarkL Aug 04 '17 at 18:26
  • MarkL - yes, WebBrowser control claims to be IE and uses the relevant DLL, but in practice (very certainly in VB6, and also in later VS 2008-2010) it doesn't behave in exactly the same way as IE in circumstances beyond the very simple - iFrames always crash it for example. My answer is based on the practicalities of dealing with VB6. – Tony Duffill Aug 04 '17 at 18:39