none
how to block ads in webbrowser website RRS feed

  • Question

  • I am using visual basic 2010 express, made a window form and a webbrowser. I want to block the add of webbrowser. help for coding to block ads

    KAILASH PRAJAPATI

    Saturday, September 6, 2014 10:07 AM

Answers

  • I am using visual basic 2010 express, made a window form and a webbrowser. I want to block the add of webbrowser. help for coding to block ads

    In my Webbrowser control of window form.


    KAILASH PRAJAPATI

    This discussion should be helpful: http://www.vbforums.com/showthread.php?612455-RESOLVED-WebBrowser-Block-ads

    Solution1:

    Rather than loading the page directly in the webbrowser control, save it to a file, then load the file as text (using Open etc) and edit out the parts that you consider to be ad's, save the file, and finally load that edited file in the webbrowser control.

    Solution2:

    I suggest you use the hosts file. You can block IPs, and you can even add entries to it with a little VB I/O.

    This is probably the only way you're going to completely block ads from ever loading in the IE/webbrowser control.


    Best Regards,
    Please remember to mark the replies as answers if they help

    Monday, September 8, 2014 2:59 AM

All replies

  • You cannot because they can be put in the HTML in every way they want

    Success
    Cor



    Saturday, September 6, 2014 10:52 AM
  • I am using visual basic 2010 express, made a window form and a webbrowser. I want to block the add of webbrowser. help for coding to block ads

    In my Webbrowser control of window form.


    KAILASH PRAJAPATI

    Saturday, September 6, 2014 11:48 AM
  • I am using visual basic 2010 express, made a window form and a webbrowser. I want to block the add of webbrowser. help for coding to block ads

    In my Webbrowser control of window form.


    KAILASH PRAJAPATI

    This discussion should be helpful: http://www.vbforums.com/showthread.php?612455-RESOLVED-WebBrowser-Block-ads

    Solution1:

    Rather than loading the page directly in the webbrowser control, save it to a file, then load the file as text (using Open etc) and edit out the parts that you consider to be ad's, save the file, and finally load that edited file in the webbrowser control.

    Solution2:

    I suggest you use the hosts file. You can block IPs, and you can even add entries to it with a little VB I/O.

    This is probably the only way you're going to completely block ads from ever loading in the IE/webbrowser control.


    Best Regards,
    Please remember to mark the replies as answers if they help

    Monday, September 8, 2014 2:59 AM