Also to force the Web Control to use the GCF (Google Chrome Frame) include this line anywhere in the HEAD code of your page:<meta http-equiv="X-UA-Compatible" content="chrome=1">
and the page will load in your web browser control on your VFP form.

Now everything HTML5, including the HTML5 Canvas is available to you.

There are a couple of problems though - all your web pages must be hosted by a proper server as restrictions in Chrome do not normally allow opening a HTML page locally. And your web page must contain the above HTML5 tag.

So what if it does not have this tag and you do not have access to change this HTML header code?

I have included the above REG entries in the download. Install the Chrome Frame first before running that REG script. We are all done here setting up our environment to use HTML5 in VFP.

To get you started exploring the wonderful world of HTML5 and VFP I have included some basic files in a download below. Just extract them to a separate folder and run the form. It will load a basic page which sets up the html5 environment. Included is the above video code in a HTML5 page. After the form has loaded just click the "Load HTML5" button to load the page. You can actually paste any HTML5 page there and it should display.

Note that in the supplied form and its HTML code, the GCF is loaded automatically so most HTML5 pages will display correctly.

Finally you might ask, of what use is this to be able to display HTML5 content in a VFP form when I can use a web browser.?

Well over the next few months, time permitting, in subsequent posts, I will be showing you what is possible using this technique and how to interact with VFP and the Web control using Javascript, so stay tuned.

You should always supply more information if you really want help. Post your errors with maybe images on foxite forum so I know which “invalid procedure call or argument” the error is occurring in. I am very bad at guessing.

I’ve Downloaded / extracted your html5.zip and ran it. It say’s “Page Could Not be Displayed”. and it displayed outside of the form ( in a IE Browser ). I kinda changed the code from the Buttons Click Event :

and it worked. it displayed the html. but my question is when i prepend the “gcf” on a url
It displays the page perfectly, but i can’t click the form controls anymore, it’s that normal
for the web browser control.

Hello Bernard.
I’m using VFP to automate google maps in IE9 with calls like Thisform.OleIE.Document.Script.somejavascriptfunction().
I’m able to use IE9 but javascript is slooooooow on al IE’s, so I was looking for ways to speed this up (like using the chorme engine).
Will this still work if I install chromeframe and your hacks to the registry?

It looks like I’m late to this gcf party! I’m interested in using it in a VFP app where I’m currently rendering html content in the IE web browser ActiveX control. Currently, I’m seeing what I believe is memory “creep / leaks(?)” with IE. My page uses a lot of jQuery plugins and I’ve tried everything that I know to try to resolve the “leaks” but to no avail.

Do you think that using the Chrome frame will help to alleviate what I’m observing?
Does the Chrome frame add much overhead (CPU and RAM useage)?

Well the Chrome frame uses Chrome so there will be that overhead. But with today’s CPU’s and cheap memory that should not be a problem.

The best way to check for memory leaks is to display the page in the Chrome Browser itself and use the Debugging Console to see if the problem is in your code/plugins or elsewhere. If there are no leaks in Chrome then there should not be any in the Chrome frame.

Hello Bernard,
I’m trying to call a JavaScript function of the current page.
But I don’t find a way to make it work.
I used Thisform.olecontrol1.Document.Script.myFunction() but it returns me an OLE Error .

Since VFP runs so fast the page and DOM will not have loaded by the time you are calling the JS function. Also you can only access the DOM AFTER the form is Activated – after the form.Activate() has run. This is why you are getting the error.

I found the easiest solution was to do the following:

1. Add a Property to the form – isActivated = .F.
2. Add a Timer to the form with an interval = 100. Adjust/increase this if the HTML takes more time/is larger. Set Enabled = .F.
3. In the form.init:

ThisForm.Olecontrol1.navigate2(fullpath to myhtmlfile)
* wait a while for html to load
* can also check ReadyState = 4 for larger html pages
* need this to slow down VFP till the page has loaded. Also can have a loop checking for Olecontrol.ReadyState = 4
DECLARE INTEGER Sleep IN WIN32API Integer
SLEEP(200) && adjust for bigger/longer wait

4. form.ActivateIF NOT Thisform.isActivated
* Funnily enough we need to wait till the form is fully instantiated before getting the DOM object
* so we use a timer whose interval can be changed as needed for larger HTMP pages to load.
ThisForm.timer1.Enabled = .T.
Thisform.isActivated = .T.
ENDIF