Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net 如何在WinForms中阻止使用Awesomium的广告?_Vb.net_Winforms_Event Handling_Awesomium_Adblock - Fatal编程技术网

Vb.net 如何在WinForms中阻止使用Awesomium的广告?

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)来执行这些命令。基本上,我希望能够做到以下几点: 检测用户

本期包含关于在Visual Studio 2012上使用Awesomium 1.7.4.2 for WinForms(使用VB.NET作为宿主语言,在framework 4.0/4.5上使用x86发布模式)的几个问题

  • 点击事件等,不要开火
  • 来自javascripts的大量“未处理异常”消息试图打开windows等
  • 广告不可屏蔽(或似乎不可屏蔽)
  • 我想获得对这个控件的控制,以便能够告诉它简单的命令,我可以用这个可怕的控件(即WebView)来执行这些命令。基本上,我希望能够做到以下几点:

  • 检测用户何时“单击”链接(通过按键、鼠标单击、触摸),并使用.NET应用程序中的代码拦截链接
  • 我希望完全阻止Javascript在单击或其他情况下重定向浏览器
  • 我希望阻止元刷新重定向
  • 我希望能够访问源代码,并在其在WebView中呈现之前对其进行修改——例如,删除某些代码污点——但是,我不希望在本地加载源代码。这意味着我不希望从站点获取源代码,并将视图设置为包含该源代码的文件/内存,而实际上不在该站点上。必须使用该站点cookies/sessions/等将webbrowser导航到该站点
  • 我有一个简单的代码片段,花了一段时间才弄清楚,它似乎显示了实际触发的事件,但是,不确定在出现“popup”之类的类型时如何发回“donotcompleteismcommand”

    超级酷的是,如果我可以加载一个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
    
            If WebControl1.HasTargetURL = True And e.EventType = Awesomium.Core.WebViewEventType.ConsoleMessage And e.LineNumber = 1 Then
                WebControl1.Source = WebControl1.TargetURL
            End If