0

As per title, any method to allow alert message from HTML to be displayed in OpenWebkitSharp (C#)?

Scenario

  1. Browsing HTML using OpenWebkitSharp webbrowser program(C#).
  2. Clicking a button in HTML.
  3. button onclick: alert('show message');.

P.S: I'm using OpenWebkitSharp version 2.9.

Roy Lee
  • 10,572
  • 13
  • 60
  • 84

2 Answers2

0

Did you try this?

WebKitBrowser webKitSharpBrowser = new WebKitBrowser();
webKitSharpBrowser.UseJavaScript = true;
naveen
  • 53,448
  • 46
  • 161
  • 251
  • "webKitBrowser1.UseJavaScript = true;" I have checked the API, this statement is true by default :) But still can't display the alert box. Your tried already can? – Roy Lee Nov 02 '12 at 02:10
-2

U need implements that methods.

        webKitBrowser.ShowJavaScriptAlertPanel += new ShowJavaScriptAlertPanelEventHandler(delegate(object o, ShowJavaScriptAlertPanelEventArgs e) {
            MessageBox.Show(e.Message);
        });
        webKitBrowser.ShowJavaScriptConfirmPanel += new ShowJavaScriptConfirmPanelEventHandler(delegate(object o, ShowJavaScriptConfirmPanelEventArgs e) {
            e.ReturnValue = MessageBox.Show(e.Message, "", MessageBoxButtons.OKCancel) == DialogResult.OK;
        });
JimStone
  • 1
  • 1
  • 1
    This does not really answer the question. If you have a different question, you can ask it by clicking [Ask Question](http://stackoverflow.com/questions/ask). You can also [add a bounty](http://stackoverflow.com/help/privileges/set-bounties) to draw more attention to this question once you have enough [reputation](http://stackoverflow.com/help/whats-reputation). – Ondrej Janacek Dec 24 '13 at 08:13