Webbrowser control annoying security alert dialogs
-
Hello, I'm using the webbrowser control in an application where the crawling is totally automated. The problem is that sometimes the browser try to crawl an archive file or whatever. In that case a security alert dialog box pops up and my webbrowser control waits for this dialog to close. I already succeded removing all Javascript dialogs by implementing the IDocHostShowUI interface and by putting the control into the "silent" mode (put_silent()). I also implemented the IDocHostUIHandler to return S_OK or S_FALSE wherever possible to get rid of a maximum of MSHTML UI unwanted behaviours. But I still get this security alert dialogs and I have no ideas of how to avoid them. The only solution I found for the moment is to filter the links the webbrowser control can crawl in a page by removing files containing 'zip','rar','mp3','jpg','gif'... And so on. But this solution is not perfect because of the number of possible file types and because sometimes you can't even guess what it is from the URL. If only the webbrowser control could allow me to access the HTTP file headers before display, to guess what it is from the content-type ! But even if I can filter the URL I crawl, I would really like a solution to remove the security alert dialogs. I also tried to tweak the Internet Explorer options to avoid prompts and dialogs but I didn't solve this problem. Any idea ? Thanks, R. LOPES Just programmer.
-
Hello, I'm using the webbrowser control in an application where the crawling is totally automated. The problem is that sometimes the browser try to crawl an archive file or whatever. In that case a security alert dialog box pops up and my webbrowser control waits for this dialog to close. I already succeded removing all Javascript dialogs by implementing the IDocHostShowUI interface and by putting the control into the "silent" mode (put_silent()). I also implemented the IDocHostUIHandler to return S_OK or S_FALSE wherever possible to get rid of a maximum of MSHTML UI unwanted behaviours. But I still get this security alert dialogs and I have no ideas of how to avoid them. The only solution I found for the moment is to filter the links the webbrowser control can crawl in a page by removing files containing 'zip','rar','mp3','jpg','gif'... And so on. But this solution is not perfect because of the number of possible file types and because sometimes you can't even guess what it is from the URL. If only the webbrowser control could allow me to access the HTTP file headers before display, to guess what it is from the content-type ! But even if I can filter the URL I crawl, I would really like a solution to remove the security alert dialogs. I also tried to tweak the Internet Explorer options to avoid prompts and dialogs but I didn't solve this problem. Any idea ? Thanks, R. LOPES Just programmer.
Is the security alert from ActiveX controls with the Yes No buttons? If so then set your security to maximum and it wont even attempt to download them. Todd Smith
-
Is the security alert from ActiveX controls with the Yes No buttons? If so then set your security to maximum and it wont even attempt to download them. Todd Smith
Hello, No, it's not the ActiveX download. With a proper configuration I avoided all ActiveX dialog boxes. No I get a security alert for any kind of file that is not HTML like JPEG, GIF, MP3. In that case the browser normally ask if you want to download them, but I disabled this kind of download in IE configuration, so instead of a dialog box asking if I want to download the file I get a security alert dialog box telling me that my level of security is too high to allow the download. And I want to get rid of this security alert dialog. Thanks, R. LOPES Just programmer.
-
Hello, No, it's not the ActiveX download. With a proper configuration I avoided all ActiveX dialog boxes. No I get a security alert for any kind of file that is not HTML like JPEG, GIF, MP3. In that case the browser normally ask if you want to download them, but I disabled this kind of download in IE configuration, so instead of a dialog box asking if I want to download the file I get a security alert dialog box telling me that my level of security is too high to allow the download. And I want to get rid of this security alert dialog. Thanks, R. LOPES Just programmer.
In that case I suggest hooking into the Invoke method and canceling any DISPID_FILEDOWNLOAD requests. If you need to support older browsers that don't support that DISPID you'll either have to filter by extension or do API hooking to get the header info similar to this tool http://www.blunck.info/iehttpheaders.html Todd Smith
-
In that case I suggest hooking into the Invoke method and canceling any DISPID_FILEDOWNLOAD requests. If you need to support older browsers that don't support that DISPID you'll either have to filter by extension or do API hooking to get the header info similar to this tool http://www.blunck.info/iehttpheaders.html Todd Smith