Logo
My Account |  Site Map | Contact Us  
Welcome Guest Search | Active Topics | Sign In | Register

HOWTO get IFRAMES to render when using a ResourceHandler for HTTP. Options
JSB
Posted: Monday, July 24, 2017 3:05:09 PM
Rank: Advanced Member
Groups: Member

Joined: 1/2/2017
Posts: 32
Please help,

I'm trying to dynamically create IFRAME objects in a HTML/jQuery page rendered with the EO.WebBrowser, that in turn, was created by using a ResourceHandler. When my page gets called, my ResourceHandler works fine, and it passes down the HTML/jQuery logic fine, which works fine to create the IFRAME, and specify the IFRAME's "src" and then append it to the DOM of the page. All works fine, and in turn, the same ResourceHandler gets called for when the IFRAME gets launched. But, after the ResourceHandler gets done, and the proper HTML is passed down to the output stream, the IFRAME does not render it. The IFRAME only gets the following HTML:

<html><head></head><body marginwidth="0" marginheight="0"></body></html>

This HTML is not mine, which I can easily tell, as I never use the [marginwidth="0" marginheight="0"] notation for anything, let alone the <body>.

When I don't use my ResourceHandler, the IFRAMEs work correctly, and I am easily able to swap out the use of my ResourceHandler, by a simple flag, so I know my HTML.jQuery is fine.

What am I missing?

Does the EO.WebBrowser need somrthing more in the ResourceHandler for IFRAMES to work?
eo_support
Posted: Monday, July 24, 2017 11:09:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,072
Hi,

Please handle WebView.ConsoleMessage to trace out the JavaScript console messages. Most likely you will get some kind of JavaScript exception.

The most likely reason that you get JavaScript exception is due to cross site scripting (XSS) check. As a security measure, by default the browser engine does not allow script from one site to acts on pages loaded from another site. So if your main page is from "http://server1/app1/page1.html" and your iframe src is "http://myspecialhandler/app1", then these are considered two different sites and scripting between them are prohibited.

There are two ways to work around this. One way is to make sure the domain portion of your customer resource handler matches the domain of the host page. Another way is to turn XSS check off by setting this property to false:

https://www.essentialobjects.com/doc/eo.webengine.browseroptions.enablewebsecurity.aspx

You can find more information on how to set browser options here:

https://www.essentialobjects.com/doc/webbrowser/advanced/browser_options.aspx

Please let us know if it works for you.

Thanks!
JSB
Posted: Tuesday, July 25, 2017 12:48:42 PM
Rank: Advanced Member
Groups: Member

Joined: 1/2/2017
Posts: 32
I have new information on this issue. It was due to another problem, which I resolved, and is documented here:

https://www.essentialobjects.com/forum/postsm43768_HOWTO-Make-the-ResourceHandler-run-faster.aspx#43768

eo_support
Posted: Tuesday, July 25, 2017 10:22:53 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 23,072
Thanks for the update!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.