Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Webbrowser control annoying security alert dialogs

Webbrowser control annoying security alert dialogs

Scheduled Pinned Locked Moved C / C++ / MFC
javascriptdesignsecurityhelptutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GriffonRL
    wrote on last edited by
    #1

    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.

    T 1 Reply Last reply
    0
    • G GriffonRL

      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.

      T Offline
      T Offline
      Todd Smith
      wrote on last edited by
      #2

      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

      G 1 Reply Last reply
      0
      • T 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

        G Offline
        G Offline
        GriffonRL
        wrote on last edited by
        #3

        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.

        T 1 Reply Last reply
        0
        • G GriffonRL

          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.

          T Offline
          T Offline
          Todd Smith
          wrote on last edited by
          #4

          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

          G 1 Reply Last reply
          0
          • T 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

            G Offline
            G Offline
            GriffonRL
            wrote on last edited by
            #5

            Thanks ! I will take a look. Regards, R. LOPES Just programmer.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups