在webBrowser控件中,我知道可以这么执行:
NavigateComplete2事件中加入:
brwWebBrowser.Document.parentWindow.execScript "window.open=null;"
这样子就可以对window.open方法进行了重写,
现在,我在下载使用vbMHWB这个控件,因为我要过滤图片下载,
而且我发现,如果在NavigateComplete2事件中加入:
brwWebBrowser.Document(iCur).parentWindow.execScript "window.open=null;"一运行后,系统会报错: 拒绝访问,然后停在这个命令行.请问,在vbMHWB这个控件中,我怎么才能做到对window.open(),window.focus()这类函数的重写?让访问的网页不执行,这些命令?哪个可以帮我一下,我已经转了快一个星期了,一直没有解决,GOOLE,都GOOLE了好多次了.
以下是我的控件的下载地址;
http://www.codeproject.com/atl/vbmhwb.asp
解决方案 »
- vb 变量的定义问题!!谢谢
- ACCESS数据库数据读取方法
- vb 如何拦截数据包
- 各位大哥大姐帮帮我,求一个复杂的SQL语句!我只有20分,全部奉上,高手们就当我做好事吧!!!!
- 提取媒体文件(.mpg)的媒体信息~
- vb 中将一个字符串的所有空格去除是哪个han数啊?
- 高分,access 中大二进制数。
- 帮忙解决:做个控制暴风影音进度的程序.
- 如何在状态栏panel中显示带秒的系统时间?
- 请问如何将2幅图片加载到内存中进行处理然后显示在PICTUREBOX上!
- VB6.0下如何用API实现串口通讯??
- Run-time error 10: "This array is fixed or temporarily locked"
brwWebBrowser.Document(iCur).parentWindow.execScript "window.alert=null;" '<------error here! access refuse 访问拒绝
brwWebBrowser.Document(iCur).parentWindow.execScript "window.confirm=null;"
brwWebBrowser.Document(iCur).parentWindow.execScript "window.showModalDialog=null;"
brwWebBrowser.Document(iCur).parentWindow.execScript "window.showModelessDialog=null;"
brwWebBrowser.Document(iCur).parentWindow.execScript "window.open=null;"
brwWebBrowser.Document(iCur).parentWindow.execScript "window.focus=null;"
brwWebBrowser.Document(iCur).parentWindow.execScript "window. önunload=null;"
brwWebBrowser.Document(iCur).parentWindow.execScript "window.attachEvent=null;"
brwWebBrowser.Document(iCur).parentWindow.execScript "window.eval=null;"
brwWebBrowser.Document(iCur).parentWindow.execScript "eval=null;"
在http://www.mvps.org/emorcillo/en/code/vb6/index.shtml中可以找到定制WebBrowser的例子(注意看它的说明)
这里面是个自定义的webbrowser控件(和vbmhwb.dll功能基本上相同,不同的是这个控件是用vb写的),看看人家是怎么封装的
谢谢.请问一个,webbrower加载工具条,怎么来实现?自动加载google,baidu这类的工具条.三天后结贴.
里面有几个优秀的关于WebBrowser的例子和Source Code。
Dim a For Each a In vbWB1.Document.getElementsByTagName("A") MsgBox fastemaila.href
Next
End Sub