0

Dear software developers,

A WinForm application using WebBrowser control that is hosting html5 webapp. It use two HTML5 features: 1. Application Cache 2. Local Storage

Application Cache works perfect. The Local Storage does not work. (typeof(Storage) == "undefined")

When requesting http://html5test.com in the WebBrowser control it shows: "You are using Internet Explorer 11.... " and full support for both Application Cache and Local Storage.

What need I do in order to enable the WebBrowser control to handle Local Storage?

All hints that guid me in the right direction are more than welcome.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
StephanC
  • 97
  • 1
  • 1
  • 7
  • possible duplicate of [C# webbrowser Ajax call](http://stackoverflow.com/questions/18333459/c-sharp-webbrowser-ajax-call) – noseratio Mar 20 '14 at 06:37

1 Answers1

0

Different browser has different support/syntax for Html5 feature, which is bad,very bad,

but, in IE, you should try var storage = window.localStorage;

Hope this helps!

BTW: this is because behind the browser, all major browsers have their own javascript engine, some method even they have the same name, but they behave differently, bad , very bad,

Like Error() method, you will find different implementation in IE and Firefox and Chrome, bad, it's very bad!!!

Kevin Simple
  • 1,225
  • 10
  • 22
  • Thank you very much. That explains it. Local storage (LS) seems to work ok. the application stores data online using LS but encounter problem offline that was first thought as a LS problem but it seem to be something else. Thanks again for you reply. Stephan – StephanC Mar 20 '14 at 09:33
  • Case closed: Local Storage works very well via WebBrowser Control. It was an Ajax bug that caused the error. xmlHttp.send(null) executed offline made the application (WebBrowser control) to crash completely. Thanks again for your tips Stephan – StephanC Mar 20 '14 at 14:20