Vb.net 如何在WinForms中阻止使用Awesomium的广告?
本期包含关于在Visual Studio 2012上使用Awesomium 1.7.4.2 for WinForms(使用VB.NET作为宿主语言,在framework 4.0/4.5上使用x86发布模式)的几个问题Vb.net 如何在WinForms中阻止使用Awesomium的广告?,vb.net,winforms,event-handling,awesomium,adblock,Vb.net,Winforms,Event Handling,Awesomium,Adblock,本期包含关于在Visual Studio 2012上使用Awesomium 1.7.4.2 for WinForms(使用VB.NET作为宿主语言,在framework 4.0/4.5上使用x86发布模式)的几个问题 点击事件等,不要开火 来自javascripts的大量“未处理异常”消息试图打开windows等 广告不可屏蔽(或似乎不可屏蔽) 我想获得对这个控件的控制,以便能够告诉它简单的命令,我可以用这个可怕的控件(即WebView)来执行这些命令。基本上,我希望能够做到以下几点: 检测用户
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
If WebControl1.HasTargetURL = True And e.EventType = Awesomium.Core.WebViewEventType.ConsoleMessage And e.LineNumber = 1 Then
WebControl1.Source = WebControl1.TargetURL
End If