private void WebKit_NavigationRequested(object sender, NavigationRequestedEventArgs args)
        {
            if (args.IsNewWindow) {
                var result = MessageBox.Show(
                    String.Format(
                        "The page at {0} has asked to open a new window containing the following page:\r\n{1}\r\nWould you like to load it?",
                        args.Referrer, args.Url
                    ),
                    "New window request",
                    MessageBoxButtons.YesNo
                );

                args.CancelDefaultAction = (result != DialogResult.Yes);
            }
        }
Beispiel #2
0
 private void WebKit_NavigationRequested(Window source, string url, string referrer, bool isNewWindow, ref bool cancelDefaultAction)
 {
     if (NavigationRequested != null) {
         var args = new NavigationRequestedEventArgs(url, referrer, isNewWindow, cancelDefaultAction);
         NavigationRequested(this, args);
         cancelDefaultAction = args.CancelDefaultAction;
     }
 }