Hi Jeremie,
I’ve had same problem with HTML viewer in my desktop apps. On Windows the Webkit Engine does not work and safe cookies because of limited user security. In IE because of strnge (I would say stupid) engine behavoir. Even with installed IE11, IE7 or Ie8 is used for rendering in HTMLviewer without support for modern CSS. You can read more on this issue here.
As solution I am checking, if my app is registred for current IE rendering engine in Windows Registry using two methods Readregistry and Writeregistry. The problem is there is also a difference between 32Bit and 64Bit Windows so you have to check twice.
Here is the code in app.open event. Replace YOUREXEFILENAME.exe with your file name. My Read and Write functions are inside a class named “TheCore” I am using in different projects but of course you can put them anywhere else.
// Registry Hack fr Windows Platform damit HTML Viewer ohne Einschrnkungen luft
#if TargetWin32
dim Sys as new TheCore
dim b as Boolean = false
// 32 Bit on 64 Bit System
if cstr(Sys.ReadRegistry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION","YOUREXEFILENAME.exe")) = "" then
b = Sys.WriteRegistry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION","YOUREXEFILENAME.exe",11999,1)
end if
// 32Bit only System (or 64 Bit)
if b=false and cstr(Sys.ReadRegistry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION","YOUREXEFILENAME.exe")) = "" then
b = Sys.WriteRegistry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer\\MAIN\\FeatureControl\\FEATURE_BROWSER_EMULATION","YOUREXEFILENAME.exe",11999,1)
end if
#endif
And these are the IO functions:
function WriteRegistry(Folder As String, Key As String, NewValue as Variante, optional RegType as Integer = 0) as Boolean
Dim myRegItem As RegistryItem
Dim found As Boolean = true
Dim elements(-1), path As String
elements = folder.split("\")
For i As Integer = 0 To Elements.Ubound
try
path = path + elements(i) + "\"
myRegItem = New RegistryItem(path, True)
Catch err As RegistryAccessErrorException
found = False
Exit for
Finally
end try
Next
If found and myRegItem <> Nil Then
try
select case RegType
case 1
// Verwende DWORD
myRegItem.value(key) = NewValue.IntegerValue
case else
// Verwende STRING
myRegItem.value(key) = NewValue.StringValue
end select
return true
Catch err As RegistryAccessErrorException
Return false
Finally
end try
Else
Return false
End If
end function
function ReadRegistry(Folder As String, Key As String) as Variant
Dim myRegItem As RegistryItem
Dim found As Boolean = true
Dim elements(-1), path As String
try
elements = folder.split("\")
For i As Integer = 0 To Elements.Ubound
path = path + elements(i) + "\"
myRegItem = New RegistryItem(path, False)
Next
Catch err As RegistryAccessErrorException
found = False
Finally
end try
If found and myRegItem <> Nil Then
try
if myRegItem.value(key) <> nil then
return myRegItem.value(key)
else
return ""
end if
Catch err As RegistryAccessErrorException
Return ""
FInally
end try
Else
Return ""
End If
end function
Hope I could help, greetings to France!