Embed web browser

I am trying to embed Firefox into a Windows Xojo desktop programme that I am developing on OS X. Does anyone have any example code etc of how I can do this as I have been trying for hours and getting nowhere! I have tried using the WebViewer but it is not good enough to do what I need e.g. it doesn’t render the web pages correctly in Windows (works fine on OS X) in either WebKit or Native mode.

Have you tried using the latest native rendering engine?
https://forum.xojo.com/21584-webbrowser-msie-version-setting/p1#p180142

The Microsoft Web Browser Active X is very nice, too.

I don’t recall seeing anything about embedding FireFox.

There is a FireFox Active X at http://www.iol.ie/~locka/mozilla/control.htm

Thanks for the info. Is it possible to continue to code on OSX even though I would be using Windows Active X etc. I realise I can’t use the Active X on OS X but do I need to switch my development to a Windows OS to do this or does Xojo handle this in some magic way?

[quote=293090:@Tim Parnell]Have you tried using the latest native rendering engine?
https://forum.xojo.com/21584-webbrowser-msie-version-setting/p1#p180142[/quote]

Tim, I have looked at the link which looks interesting but I am not sure what you mean by “I think there is a working copypasta blob somewhere if you search for it.”

It may be that what you’re getting using the built in native browser is a legacy compatibility behaviour from the IE engine
(basically it used to default to IE 6 or 7 compatibility mode)

There should be some code around that allows you to force it to act as the very latest version that is installed which oftens cures a a lot of ugly output issues in html viewers

This one might help
https://forum.xojo.com/18988-take-htmlviewer-out-of-ie-compatibility-mode

along with these
https://forum.xojo.com/21584-webbrowser-msie-version-setting/p1#p180142
http://www.realsoftwareblog.com/2011/01/changing-htmlviewer-rendering-mode-on.html

Not really useful as you cant embed them (we cant read the OLE controls doc etc on OS X)
And to embed something other than the IDE’s html viewer you’d need this (so you could get the object ID for the FF ole control etc)
It would be like trying to build an iOS project on Windows or Linux - you could edit code and thats all
You cant test anything etc

There is a working Blob of Code™ that automatically determines the best rendering engine level and sets it. It’s floating around somewhere though, but I couldn’t find it then, and can’t find it now. But I swear I’ve seen it!

It’s unfortunate that the Chromium Embedded Framework is so very out of date. If Xojo would update it a number of display issues would be fixed.

Thanks everyone, the tweaking the registry appears to have worked on my home Windows PC so will give it a try on the office box tomorrow. I never ceases to amaze me that Microsoft make you have to jump through hoops to do something that should be so easy. Again thanks to you all for the quick replies, its much appreciated.

Microsoft is not making you do anything. It provides a way to set the type of browser, which you use or not. Heck, setting a registry value is a lot simpler than the declares needed in anything of the sort under macOS.

Because you are not familiar with an environment does not mean its conceptor is hostile.

[quote=293158:@Michel Bujardet]Microsoft is not making you do anything. It provides a way to set the type of browser, which you use or not. Heck, setting a registry value is a lot simpler than the declares needed in anything of the sort under macOS.

Because you are not familiar with an environment does not mean its conceptor is hostile.[/quote]
Yeah I guess that is a fair point, I have been a Microsoft person for 25+ years and moved to Mac about 3 years ago (even though I swore I never would). I just find every time I need to do something on Windows it turns out to be a hassle whereas things just feel easier on OSX. Admittedly I have not tried to do anything too complex on OSX yet :wink:

Most recent blog post about switching the IE renderer on Windows:

http://blog.xojo.com/2016/01/04/use-newer-version-of-internet-explorer-with-webbrowser-and-htmlviewer/

[quote=293163:@Paul Lefebvre]Most recent blog post about switching the IE renderer on Windows:

http://blog.xojo.com/2016/01/04/use-newer-version-of-internet-explorer-with-webbrowser-and-htmlviewer/[/quote]
Thanks Paul, I will add that to my toolbox of useful functions :slight_smile:

[quote=293153:@Tim Parnell]
It’s unfortunate that the Chromium Embedded Framework is so very out of date. If Xojo would update it a number of display issues would be fixed.[/quote]
CEF 1 vs CEF 3 is quite different so its not “oh just drop the new one in and go”
CEF 3 requires a very different architecture since it moves from living in a single process to async messaging between multiple processes

Don’t be fooled by Mac very polished UI. Whenever you want to go under the hood, it is WAY more complex than under Windows.

[quote=293169:@Norman Palardy]CEF 1 vs CEF 3 is quite different so its not “oh just drop the new one in and go”
CEF 3 requires a very different architecture since it moves from living in a single process to async messaging between multiple processes[/quote]
I didn’t say it would be easy.
I would prefer it got some attention though.

Human cloning can’t happen fast enough

[quote=293163:@Paul Lefebvre]Most recent blog post about switching the IE renderer on Windows:

http://blog.xojo.com/2016/01/04/use-newer-version-of-internet-explorer-with-webbrowser-and-htmlviewer/[/quote]
I have just tried to use your blog post and noticed that on the first line the backslashes appear to be missing in the post which stops the function from working correctly. I think it should be HKEY_LOCAL_MACHINE\Software\Microsoft rather than HKEY_LOCAL_MACHINESoftwareMicrosoft as shown in the post. I guess they got removed when you put the post up.

Thanks for catching that. It looks like the slashes got obliterated when the blog moved over to WordPress this summer. I’ve updated the post.

Note that on Windows 10 you are going to need admin rights to change the registry.