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#
  4. Need help on this issue with WebBrowser control

Need help on this issue with WebBrowser control

Scheduled Pinned Locked Moved C#
helpquestioncsharpjavascripthtml
7 Posts 3 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 currently playing a lot with the WebBrowser control and C#. I made several programs interacting with the DOM of pages I use for testing. One of my programs traverse the DOM tree of a page, find all the images tags and click on them. Nothing really fancy ;P. My point is sometimes when I click on an image a JavaScript is called in the page and this JavaScript opens a messagebox using window.alert. The problem is that I want to execute the scripts but disable those modal messageboxes who freeze my program. My question is: how to disable the window.alert function ? Or how to intercept a window.alert call ? I explored the window object and I think you can't not change the window.alert default behaviour. Thanks, R. L.

    S S 2 Replies Last reply
    0
    • G GriffonRL

      Hello, I'm currently playing a lot with the WebBrowser control and C#. I made several programs interacting with the DOM of pages I use for testing. One of my programs traverse the DOM tree of a page, find all the images tags and click on them. Nothing really fancy ;P. My point is sometimes when I click on an image a JavaScript is called in the page and this JavaScript opens a messagebox using window.alert. The problem is that I want to execute the scripts but disable those modal messageboxes who freeze my program. My question is: how to disable the window.alert function ? Or how to intercept a window.alert call ? I explored the window object and I think you can't not change the window.alert default behaviour. Thanks, R. L.

      S Offline
      S Offline
      Sijin
      wrote on last edited by
      #2

      A very crude method would be to read in the script before clicking the image and then remove, or comment out any calls to window.alert What do u think?...too much work maybe ;) ;) May the Source be with you Sonork ID 100.9997 sijinjoseph

      G 1 Reply Last reply
      0
      • S Sijin

        A very crude method would be to read in the script before clicking the image and then remove, or comment out any calls to window.alert What do u think?...too much work maybe ;) ;) May the Source be with you Sonork ID 100.9997 sijinjoseph

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

        Hello, Thank you for your idea but it is note very nice. I would prefer a solution: - to redefine the window.alert behaviour and cancel the opening. - or to catch all the modal messageboxes opening from IE and close them. Any idea ? R. L.

        1 Reply Last reply
        0
        • G GriffonRL

          Hello, I'm currently playing a lot with the WebBrowser control and C#. I made several programs interacting with the DOM of pages I use for testing. One of my programs traverse the DOM tree of a page, find all the images tags and click on them. Nothing really fancy ;P. My point is sometimes when I click on an image a JavaScript is called in the page and this JavaScript opens a messagebox using window.alert. The problem is that I want to execute the scripts but disable those modal messageboxes who freeze my program. My question is: how to disable the window.alert function ? Or how to intercept a window.alert call ? I explored the window object and I think you can't not change the window.alert default behaviour. Thanks, R. L.

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          html filter proxy


          How low can you go ?
          (MS retrof_u_ck)

          G 1 Reply Last reply
          0
          • S Stephane Rodriguez

            html filter proxy


            How low can you go ?
            (MS retrof_u_ck)

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

            Hello Stephane, Thanks for answering me again. Your solution sounds good but what is the technical meaning of this term ? I apologize for my lack of knowledge :-D. I'm starting to search about html filter. R. L.

            S 1 Reply Last reply
            0
            • G GriffonRL

              Hello Stephane, Thanks for answering me again. Your solution sounds good but what is the technical meaning of this term ? I apologize for my lack of knowledge :-D. I'm starting to search about html filter. R. L.

              S Offline
              S Offline
              Stephane Rodriguez
              wrote on last edited by
              #6

              html filter proxy[^] No need to tell me that's exactly what you are looking for. I know.;P


              How low can you go ?
              (MS retrof_u_ck)

              S 1 Reply Last reply
              0
              • S Stephane Rodriguez

                html filter proxy[^] No need to tell me that's exactly what you are looking for. I know.;P


                How low can you go ?
                (MS retrof_u_ck)

                S Offline
                S Offline
                Sijin
                wrote on last edited by
                #7

                Overkill i think :):):) May the Source be with you Sonork ID 100.9997 sijinjoseph

                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