WebHTMLViewer does not load google, yahoo, youtube

Why is it that I cannot load google page from a WebHTMLViewer? Or youtube? or Yahoo?

Is there a workaround?

I actually do not want to load google, but a web interface in a device connected in LAN which seems to be the same problem.

Thanks!

Those websites may block being embedded. Maybe you better use a desktop app.

Mmm…

I have a WebApp for monitoring a measuring system. For a special customer we need to integrate some additional external sensors which are LAN connected. It has a built-in web interface already and I just want to embed it using a WebHTMLViewer to the current interface. But the WebHTMLViewer is not able to display it.

I do not know why this device does not allows to be embedded. It would really save a lot of work.

One of the reasons that a site might not do this is to prevent the loss of secure connections. If your app is running http, but the frame is running https, the user would have no way to know ( except some miscellaneous warnings about loading secure and non-secure content on the same page.

I had the same problem with the WebHTMLViewer. It appears that the control uses iframe method unfortunately To help prevent clickjacking, Web site owners can send an HTTP response header named X-Frame-Options with HTML pages to restrict how the page may be framed. - X-Frame-Options: Deny

I ended up doing this in the end as a workaround.

  1. You will to enable PHP support in IIS/Apache etc.
  2. Open up a text editor and add this line [quote]<?php echo file_get_contents('http://www.google.com/'); ?>[/quote] and save it as a php file ie: google.php
  3. Create another file ie: frame.html and add [quote][/quote]
  4. Load frame.html into the WebHTMLviewer we control ie: [quote]http://127.0.0.1/frame.html[/quote]

:slight_smile: it’s not super dooper but worked in my case

@Greg Olone

I tried with https as well… no success. Thanks for the tip anyway.

@Lee Page

Worked great… with Google and YouTube. So if someone reads this post that is one way to go. However, in my case it still does not load the interface of my device. I guess is something in the html page of the device’s interface.

Sadly, I am not an html expert to figure it out… that is why I am programming in Xojo in the first place.

This is the source code of the interface page I want to embed. I got it from chrome with right click… if someone is interested to check it out… maybe there is something obvious there that I am missing.

WuT - Diagram
Home User
 

Thanks to all!

Hi Roberto

I found this link to a device on google (your posted html code looks similar)

Wiesemann Device

Looks as though the embedded webserver device html pages also use iframe/framesets. I may have a workaround for you and will look at this for you this evening.

:slight_smile:

Lee,

That is exactly the same interface I am trying to embed. Different model with less instruments, but same manufacturer. If you try to access the address you gave me with a WebViewer, it does not load anything. Neither the php trick (but it worked beatifully with youtube, yahoo and google).

Thanks Lee, it would be great if you know/have a workaround.

:slight_smile:

Roberto:

Did you ever find a work around?

Hi Jay,

Not for the sensor interface. But for google and youtube, the first suggestion given by Lee Page worked.