此问题包含有关在Visual Studio 2012上使用Awesomium 1.7.4.2 for WinForms的几个问题,使用VB.NET作为主机语言,并在框架4.0 / 4.5上使用x86发布模式
我想控制这个控件,以便能够告诉它我能用恐怖控件(IE WebView)做的简单命令。基本上,我希望能够做到以下几点:
我有这个简单的片段需要一段时间来弄清楚,它似乎显示实际正在触发的事件,但是,如果类型不确定如何发送回“不要完成此命令”比如“popup”。
如果我可以加载一个crx文件作为插件,那将是非常酷的,因为这是一个原生的Chrome浏览器组件---当然,插件是“AdBlock Plus”,它将处理所有广告拦截和这样。然后我只需要处理弹出窗口 - 而不是内联广告废话。
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
WebControl1.Source = New Uri("http://vidbull.com/k1ie8l9kchme.html")
End Sub
Private Sub WebControl1_ConsoleMessage(sender As Object, e As Awesomium.Core.ConsoleMessageEventArgs) Handles WebControl1.ConsoleMessage
If WebControl1.HasTargetURL = True And e.EventType = Awesomium.Core.WebViewEventType.ConsoleMessage And e.LineNumber = 1 Then
WebControl1.Source = WebControl1.TargetURL
End If
If e.EventName = "popup" Then
End If
Debug.Print(e.EventName & " - " & e.Message & " - " & e.EventType & " - " & e.LineNumber)
End Sub
End Class
以下是加载此页面的控制台的示例输出。
ConsoleMessage - Uncaught TypeError: Cannot read property 'style' of null - 15 - 166
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=27&target=_blank. Domains, protocols and ports must match. - 15 - 1
当你在页面上“点击”任何地方(没有超链接区域)
ConsoleMessage - Uncaught TypeError: Object #<HTMLHtmlElement> has no method 'webkitRequestFullscreen' - 15 - 1
ConsoleMessage - event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future. - 15 - 1
ConsoleMessage - event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future. - 15 - 1
当您“点击”“继续观看视频”链接时
ConsoleMessage - Uncaught TypeError: Object #<HTMLHtmlElement> has no method 'webkitRequestFullscreen' - 15 - 1
ConsoleMessage - event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future. - 15 - 1
ConsoleMessage - event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future. - 15 - 1
ConsoleMessage - Uncaught TypeError: Cannot read property 'style' of null - 15 - 166
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=31&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=29&target=_blank. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://highspeedtesting.com/adserver/300.html from frame with URL http://divasroom.com/adserver/300.html. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://highspeedtesting.com/adserver/300x.html from frame with URL http://divasroom.com/adserver/300.html. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://xp2.zedo.com/jsc/xp2/ff2.html?n=2702;c=20;s=18;d=9;w=300;h=250 from frame with URL http://divasroom.com/adserver/300.html. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://cdn.adnotch.com/www/delivery/afr.php?zoneid=35&target=_blank from frame with URL http://divasroom.com/adserver/300.html. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://divasroom.com/adserver/300.html. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://vidbull.com/k1ie8l9kchme.html from frame with URL http://nym1.ib.adnxs.com/if?enc=tD2ZBQvEwj-O3GWIECa8P5zEILByaOE_jtxliBAmvD-0PZkFC8TCP3nb6L0gRkwUCMjmCLympnU4lshTAAAAAKjyLQBNBQAAsQAAAAIAAAABbNsA7soGAAAAAQBVU0QAVVNEACwB-gA_fQAAj6QAAgUAAQIAAJIAOSc8aQAAAAA.&cnd=%21PiQwywj7gVMQgdjtBhgAIO6VGzAAOABAAEixAVCo5bcBWABgWGgAcAB4AIABAIgBAJABAZgBAaABAagBA7ABALkBtD2ZBQvEwj_BAbQ9mQULxMI_yQEsvFQJvUbvP9kBAAAAAAAA8D_gAQDqAQD1Ac3MTD4.&ccd=%21CgaxNQj7gVMQgdjtBhjulRsgAA..&udj=uf%28%27a%27%2C+379%2C+1405654584%29%3Buf%28%27c%27%2C+1360123%2C+1405654584%29%3Buf%28%27r%27%2C+14380033%2C+1405654584%29%3Bppv%2810929%2C+%271462621085427620729%27%2C+1405654584%2C+1405654644%2C+1360123%2C+445166%2C+0%2C+0%2C+10368000%29%3B&vpid=366&apid=415585&referrer=http%3A%2F%2Fdivasroom.com%2Fadserver%2F300.html&media_subtypes=1&ct=0&rsrc=2&dlo=1. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL http://nym1.ib.adnxs.com/if?enc=tD2ZBQvEwj-O3GWIECa8P5zEILByaOE_jtxliBAmvD-0PZkFC8TCP3nb6L0gRkwUCMjmCLympnU4lshTAAAAAKjyLQBNBQAAsQAAAAIAAAABbNsA7soGAAAAAQBVU0QAVVNEACwB-gA_fQAAj6QAAgUAAQIAAJIAOSc8aQAAAAA.&cnd=%21PiQwywj7gVMQgdjtBhgAIO6VGzAAOABAAEixAVCo5bcBWABgWGgAcAB4AIABAIgBAJABAZgBAaABAagBA7ABALkBtD2ZBQvEwj_BAbQ9mQULxMI_yQEsvFQJvUbvP9kBAAAAAAAA8D_gAQDqAQD1Ac3MTD4.&ccd=%21CgaxNQj7gVMQgdjtBhjulRsgAA..&udj=uf%28%27a%27%2C+379%2C+1405654584%29%3Buf%28%27c%27%2C+1360123%2C+1405654584%29%3Buf%28%27r%27%2C+14380033%2C+1405654584%29%3Bppv%2810929%2C+%271462621085427620729%27%2C+1405654584%2C+1405654644%2C+1360123%2C+445166%2C+0%2C+0%2C+10368000%29%3B&vpid=366&apid=415585&referrer=http%3A%2F%2Fdivasroom.com%2Fadserver%2F300.html&media_subtypes=1&ct=0&rsrc=2&dlo=1 from frame with URL http://rc.rlcdn.com/281411.html?redirect=1. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Given URL is not allowed by the Application configuration.: One or more of the given URLs is not allowed by the App's settings. It must match the Website URL or Canvas URL, or the domain must be a subdomain of one of the App's domains. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL https://www.facebook.com/plugins/share_button.php?app_id=172525162793917&channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2FbLBBWlYJp_w.js%3Fversion%3D41%23cb%3Df2ee32fd0%26domain%3Dvidbull.com%26origin%3Dhttp%253A%252F%252Fvidbull.com%252Ff3f898cf4%26relation%3Dparent.parent&href=http%3A%2F%2Fvidbull.com%2Fk1ie8l9kchme.html&locale=en_US&ref=.U8iWPV60qZs.share-button&sdk=joey&type=button_count. Domains, protocols and ports must match. - 15 - 1
ConsoleMessage - Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL https://www.facebook.com/plugins/like.php?action=like&app_id=172525162793917&channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter%2FbLBBWlYJp_w.js%3Fversion%3D41%23cb%3Df20b111a24%26domain%3Dvidbull.com%26origin%3Dhttp%253A%252F%252Fvidbull.com%252Ff3f898cf4%26relation%3Dparent.parent&font=arial&href=http%3A%2F%2Fvidbull.com%2Fk1ie8l9kchme.html&layout=button_count&locale=en_US&ref=.U8iWPb73hFo.like&sdk=joey&send=false&show_faces=false&width=90. Domains, protocols and ports must match. - 15 - 1
然后打开视频页面,该视频页面在视频/等上分层广告,点击后关闭它们:
ConsoleMessage - Uncaught TypeError: Object #<HTMLHtmlElement> has no method 'webkitRequestFullscreen' - 15 - 1
ConsoleMessage - event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future. - 15 - 1
ConsoleMessage - event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future. - 15 - 1
在某些页面上,单击以关闭它们,只需重定向回“查看视频”页面即可。我相信你们之前都经历过这种类型的新兴广告,但是自从使用AdBlock以来,我很高兴没有注意到事情真的变得多么糟糕。
任何用于网络常规导航的新浏览器系统都必须采用某种形式的阻止控制来防止古怪的事情发生,更重要的是,确保用户体验清晰。
在所有“Chrome”项目中,(包括CefSharp等),Awesomium是唯一一个实际呈现开箱即用页面的项目,没有无尽的修复时间,只是仍然没有前进。我也看过EssentialObjects webbrowser控件,但它也有局限性,即使IE WebView控件已经克服了。
如果有人可以帮助我解决这些问题(这些问题真的围绕着浏览器中的垃圾 - 广告 - 不干净的好广告......强制广告干扰用户体验)
提前致谢。
P.S。
以下代码是“click”“mousedown”“mouseup”等的解决方法......无法正常工作...以便实际处理该操作并将浏览器导航到新页面。如果您查看日志,您会看到它实际上是我正在使用的错误,因为该错误似乎仅在“点击”时触发这些条件。
If WebControl1.HasTargetURL = True And e.EventType = Awesomium.Core.WebViewEventType.ConsoleMessage And e.LineNumber = 1 Then
WebControl1.Source = WebControl1.TargetURL
End If