Skip to content

overriding JsDialogHandler is not hiding Javascript alerts #388

@kropewnicki

Description

@kropewnicki

my goal is to hide some javascript alerts that are popping up on my html

I have a custom JsDialogHandler with empty methods.

public class JsHandler : IJsDialogHandler
{
    public bool OnJSAlert(IWebBrowser browser, string url, string message)
    {

        return false;
    }

    public bool OnJSConfirm(IWebBrowser browser, string url, string message, out bool retval)
    {
        retval = false;
        return false;
    }

    public bool OnJSPrompt(IWebBrowser browser, string url, string message, string defaultValue, out bool retval, out string result)
    {
        retval = false;
        result="";
        return false;
    }
}

But I am still seeing javascript alerts. Is my override incorrect, or is there an issue in cefsharp JsHandler?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions