Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:35:28+00:00 2026-05-22T19:35:28+00:00

I found a similar question here: How do I suppress script errors when using

  • 0

I found a similar question here:

How do I suppress script errors when using the WPF WebBrowser control?

But non of those solutions work for me. I need to stop the popups from appearing as i am using the WebBrowser to automate admin tasks on a website.

SuppressScriptErrors does not appear to be an available attribute on my WebControl 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:35:28+00:00Added an answer on May 22, 2026 at 7:35 pm

    Here is a C# routine that is capable of putting WPF’s WebBrowser in silent mode. You can’t call it at WebBrowser initialization as it ‘s too early, but instead after navigation occured. Here is a WPF sample app with a wbMain WebBrowser component:

    public partial class Window1 : Window
    {
        public Window1()
        {
            InitializeComponent();
            wbMain.Navigated += new NavigatedEventHandler(wbMain_Navigated);
        }
    
        void wbMain_Navigated(object sender, NavigationEventArgs e)
        {
            SetSilent(wbMain, true); // make it silent
        }
    
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            wbMain.Navigate(new Uri("... some url..."));
        }
    }
    
    
    public static void SetSilent(WebBrowser browser, bool silent)
    {
        if (browser == null)
            throw new ArgumentNullException("browser");
    
        // get an IWebBrowser2 from the document
        IOleServiceProvider sp = browser.Document as IOleServiceProvider;
        if (sp != null)
        {
            Guid IID_IWebBrowserApp = new Guid("0002DF05-0000-0000-C000-000000000046");
            Guid IID_IWebBrowser2 = new Guid("D30C1661-CDAF-11d0-8A3E-00C04FC9E26E");
    
            object webBrowser;
            sp.QueryService(ref IID_IWebBrowserApp, ref IID_IWebBrowser2, out webBrowser);
            if (webBrowser != null)
            {
                webBrowser.GetType().InvokeMember("Silent", BindingFlags.Instance | BindingFlags.Public | BindingFlags.PutDispProperty, null, webBrowser, new object[] { silent });
            }
        }
    }
    
    
    [ComImport, Guid("6D5140C1-7436-11CE-8034-00AA006009FA"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    private interface IOleServiceProvider
    {
      [PreserveSig]
      int QueryService([In] ref Guid guidService, [In] ref Guid riid, [MarshalAs(UnmanagedType.IDispatch)] out object ppvObject);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've found a similar question here , but I'm looking for more general solutions.
For the record: I found a similar question here but I have to elaborate
Just that. I found a similar question here : c# console, Console.Clear problem but
I can't resolve this issue, I found a similar question here but: setting the
I found this similar question here , but this is really old. Was it
So, I found a similar question here , but the answers are more about
I found a similar question here, but didn't help me. I basically have apache
I've found a similar question on stack overflow, but it didn't really answer the
i've posted a similar question here sometime ago and found the solution by downloading
I found a similar question here: How to read attribute of a parent node

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.