HTMLviewer question

OK … used visual basic for years but new to Xojo … I have an issue with htmlviewer …

Here’s the code …
HTMLViewer1.Visible = true
HTMLViewer1.loadurl(urlfield.text)

Works to a degree … and I know the URL needs the full monty so that is (in this case) http://slither.io
But if I put in some other URLs then I often just get a white screen … or just part of the site loads (like an ad) …

Can anyone point me in the right direction?

Many Thanks!

HTML Viewer on Xojo is not able to render as much as a regular desktop browser for a number of different reasons.

On Windows you run into issues with the Renderer engine (set this in the IDE at design time) Native is an old IE renderer, and WebKit is an old WebKit engine (something along the lines of Crome 16 if I recall correctly.). On mac the property doesn’t do much, you end up with the Safari WebKit engine.

The outdated engines mean that some web technologies are not available to you.

Another issue you may be facing is the limitation that the HTML Viewer in Xojo does not have access to third party plugins like Flash and Silverlight.

Websites may also be checking your user agent string to try to figure out what version of the site to serve you (or if to serve you at all.)

There are a large number of factors that come into play when you are trying to serve someone else’s content through a HTML Viewer. I always recommend contacting the author and asking for an API if you’re serving someone else’s content.

If you are serving your own content and can change what gets loaded we may be able to help you optimize your content for the Xojo HTML Viewer here on the forum.

Got it … que sera sera then …

Sooo … bigger scene … I’ve made a “game” for my students. They have to “play it” … which is basically a “word learning game.” My students don’t like learning much … but they do like PLAYING. If they get X questions right on MY GAME then I take them straight to a REAL game for Y minutes of REAL FUN. They love this idea. I just thought I could take them right there with the HTML viewer.

Plan B then … Can I let them go the game site on regular chrome but STOP it from my app when Y amount of time has elapsed? Thoughts on best way to go about that?

Your help is very much appreciated!

What platform are you working on? I know some declares on Mac that can bring your app to the front and stay on top. But I doubt the game in the browser would pause.

Using a Mac … yup … just bringing my app to the top would be good - don’t need the browser game to pause … that’s fine.

Thanks!

What we’re looking at is activateIgnoringOtherApps:
Looks like someone has done the work of turning it into a declare already, woohoo!
https://forum.xojo.com/3929-solved-set-app-to-frontmost-app-for-app-in-mas/p2#p28039

Be sure to use the Cocoa one.

Works great - thanks!