Welcome Guest Search | Active Topics | Sign In | Register

How to control the elements of the cross domain IFRAME? Options
kevin_ll
Posted: Thursday, December 10, 2015 3:55:46 AM
Rank: Member
Groups: Member

Joined: 12/10/2015
Posts: 17
HI

"EO.Webbrowser" is a very good browser component, the performance is very good, I want to do a full automatic posting of the software, but some of the site is a cross domain, I am not in the test "EO.Webbrowser" time to find a better way to achieve

Thanks
eo_support
Posted: Thursday, December 10, 2015 10:56:07 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,201
Hi,

I am not sure if you meant cross domain script security issue. By default cross domain scripting is forbidden due to security issues. You can turn this security check off by setting this property to false:

http://www.essentialobjects.com/doc/eo.webengine.browseroptions.enablexssauditor.aspx

You can see here for more information on how to set this property:

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

Thanks!

kevin_ll
Posted: Thursday, December 10, 2015 1:51:44 PM
Rank: Member
Groups: Member

Joined: 12/10/2015
Posts: 17
Hello, this is the code in VB.Net
Code: Visual Basic.NET
Protected Overrides Sub OnCreateMainForm()
            Dim opt As New EO.WebEngine.BrowserOptions
            opt.EnableXSSAuditor = False
            EO.WebEngine.EngineOptions.Default.SetDefaultBrowserOptions(opt)
            Me.MainForm = Global.EOWEB_Demo.Form1
        End Sub


I tested it, or I can't access the elements in Iframe by JavaScript.

<- IFRAME src="b.html" id="f" ->-<- /iframe->
Code: JavaScript
alert(document.getElementById('f').contentWindow.document.location)

kevin_ll
Posted: Thursday, December 10, 2015 2:12:40 PM
Rank: Member
Groups: Member

Joined: 12/10/2015
Posts: 17
Well, thank you very much.
Code: Visual Basic.NET
BrowserOptions.EnableWebSecurity=False

If JSObject Class WebView can be transformed into Class [Iframe] is better, because he has a LoadUrl method, you can directly submit data to the web, and iframe elements can not
eo_support
Posted: Thursday, December 10, 2015 4:22:48 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,201
Hi,

Thanks for the update. I am not sure if I understand your question. Do you mean setting EnableWebSecurity works for you?

There is no IFrame class. You can use JSObject to call any method or set any property that actually exists on that object. You can see here for more details:

http://www.essentialobjects.com/doc/webbrowser/advanced/js.aspx
http://www.essentialobjects.com/doc/eo.webbrowser.jsobject.aspx

For example, if the underlying JavaScript object has a "LoadUrl" method, then you can use jsObj.InvokeFunction("LoadUrl", your_url) in your code to call that function.

Thanks!


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.