You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
By clicking “Sign up for GitHub”, you agree to our
terms of service
and
privacy statement
. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
i open an url like "
http://www.aaaaa.com
" and it has a iframe "
http://cc.cc.com
"
i can not use javascript control the ifame's dom it say cross domain error,
in ie it has same problem, i find the solution already
is there has any idea work it fine in cefsharp
sorry for my english wish your help
Try
Cef.AddCrossOriginWhitelistEntry
, I've never used it personally, so I don't have a sample. The documentation is fairly extensive.
https://github.com/cefsharp/CefSharp/blob/cefsharp/41/CefSharp.Core/Cef.h#L230
@jankurianski
id="cef.redist.x64" version="3.2272.32" targetFramework="net40" />
id="cef.redist.x86" version="3.2272.32" targetFramework="net40" />
id="CefSharp.Common" version="41.0.1" targetFramework="net40" />
id="CefSharp.WinForms" version="41.0.1" targetFramework="net40" />
my steps:
1.webBrowser = new ChromiumWebBrowser("
http://110.alibaba.com/policeHall/hallIndex.htm
")
2.when it open compelete, click the "login" at top right, then an iframe will be show and it's src is "
https://passport.alibaba.com/mini_login.htm
", it's ID is 'alibaba-login-box' i want to input my account by js
3.i run var result = webBrowser.EvaluateScriptAsync("document.getElementById('alibaba-login-box').contentWindow.window.document");
but the result.Result.Message is "Uncaught SecurityError: Blocked a frame with origin "
http://110.alibaba.com
" from accessing a cross-origin frame."
@amaitland
Cef.Initialize(new CefSettings() { Locale = "zh-CN" });
Cef.AddCrossOriginWhitelistEntry("
https://passport.alibaba.com
", "https", string.Empty, true);
Cef.AddCrossOriginWhitelistEntry("
https://passport.alibaba.com
", "http", string.Empty, true);
Cef.AddCrossOriginWhitelistEntry("
http://110.alibaba.com
", "http", string.Empty, true);
Cef.AddCrossOriginWhitelistEntry("
http://110.alibaba.com
", "https", string.Empty, true);
i try AddCrossOriginWhitelistEntry but it is error 3q
@gitlsl
You can also try disabling web security using
BrowserSettings.WebSecurityDisabled
or use the
--disable-web-security
command line argument.
Those are my only two suggestions. You should also try searching on
http://magpcss.org/ceforum/