HTMLViewer shows a different page layout compared to Chrome

Hello,

i’m loading Google images to grab some pictures from the web, however in Xojo (both with Native and WebKit renderer) i get a different page behavior compared to loading the same address in Chrome.

The link is: https://www.google.it/search?q=kittens&source=lnms&tbm=isch

Xojo HTMLViewer shows this:

Chrome shows this:

Does someone know how to get the Chrome page in Xojo?

Thanks!

Have you altered the user agent string to tell google you are chrome (or safari or another browser that is capable of displaying that UI? Note that if google does capability sniffing then it might not behave like chrome even if you alter the user agent.

There’s a couple of things that could be different…

  • Are you setting a user agent string in the HTMLViewer?
  • Google stores cookies based on the last time you were there, but HTMLViewer doesn’t store cookies.
  • HTMLViewer is an embedded browser which means that it’s not completely the same as a browser.

HTMLViewer renders what is sent from the server, so my guess is that Google is actually returning a different page.

Hi guys and thanks for your replies. Well no, i didn’t set an user agent in Xojo, don’t even know how to do it… could give me a hint?

You should really look at the docs…

https://documentation.xojo.com/index.php/HTMLViewer.UserAgent

Thanks @Greg O’Lone !
Actually it worked with agent “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36"”