public override void DecidePolicyForNavigation (WebView webView, NSDictionary actionInformation, NSUrlRequest request, WebFrame frame, NSObject decisionToken) { switch ((WebNavigationType)((NSNumber)actionInformation [WebPolicyDelegate.WebActionNavigationTypeKey]).Int32Value) { case WebNavigationType.BackForward: case WebNavigationType.FormResubmitted: case WebNavigationType.FormSubmitted: WebPolicyDelegate.DecideIgnore (decisionToken); break; case WebNavigationType.LinkClicked: NSWorkspace.SharedWorkspace.OpenUrl (actionInformation[WebPolicyDelegate.WebActionOriginalUrlKey] as NSUrl); WebPolicyDelegate.DecideIgnore (decisionToken); break; case WebNavigationType.Other: case WebNavigationType.Reload: WebPolicyDelegate.DecideUse (decisionToken); break; } }
public override void DecidePolicyForNavigation(WebView web_view, NSDictionary action_info, NSUrlRequest request, WebFrame frame, NSObject decision_token) { if (LinkClicked != null) LinkClicked (request.Url.ToString ()); }
public override void DecidePolicyForMimeType(WebView webView, string mimeType, NSUrlRequest request, WebFrame frame, NSObject decisionToken);
public override void ClearedWindowObject(WebView webView, WebScriptObject windowObject, WebFrame forFrame);
public override void CanceledClientRedirect(WebView sender, WebFrame forFrame);
public override void ChangedLocationWithinPage(WebView sender, WebFrame forFrame);
public override void FinishedLoad(WebView sender, WebFrame forFrame);
public override void ReceivedTitle(WebView sender, string title, WebFrame forFrame);
public override string UIRunJavaScriptTextInputPanelWithFrame(wk.WebView sender, string prompt, string defaultText, wk.WebFrame initiatedByFrame) { var dialog = new PromptDialog(Handler.Widget.Generator) { Prompt = prompt, Value = defaultText, Title = Handler.DocumentTitle }; var result = dialog.ShowDialog(Handler.Widget); return((result == DialogResult.Ok) ? dialog.Value : string.Empty); }
public override bool UIRunJavaScriptConfirmationPanel(wk.WebView sender, string withMessage, wk.WebFrame initiatedByFrame) { return(MessageBox.Show(Handler.Widget, withMessage, MessageBoxButtons.YesNo) == DialogResult.Yes); }
public override void UIRunJavaScriptAlertPanelMessage(wk.WebView sender, string withMessage, wk.WebFrame initiatedByFrame) { MessageBox.Show(Handler.Widget, withMessage); }
public override void DecidePolicyForNavigation(WebView web_view, NSDictionary action_info, NSUrlRequest request, WebFrame frame, NSObject decision_token) { string file_path = request.Url.ToString (); file_path = file_path.Replace ("%20", " "); NSWorkspace.SharedWorkspace.OpenFile (file_path); }
public override void DecidePolicyForNavigation(WebView web_view, NSDictionary action_info, NSUrlRequest request, WebFrame frame, NSObject decision_token) { SparkleEventLogController.LinkClicked (request.Url.ToString ()); }
public override void FinishedLoad (WebView sender, WebFrame forFrame) { document.ReloadDocument (); }
public void DecidePolicyForNavigation(wk.WebView webView, NSDictionary action, NSUrlRequest request, wk.WebFrame frame, NSObject listener) { var url = action.ObjectForKey(new NSString("WebActionOriginalURLKey")) as NSUrl; var args = new WebViewNewWindowEventArgs(new Uri(url.AbsoluteString), frame.Name); Handler.Widget.OnOpenNewWindow(args); if (!args.Cancel) { NSWorkspace.SharedWorkspace.OpenUrl(url); } listener.PerformSelector(selIgnore, null, 0); }
public override void CommitedLoad(WebView sender, WebFrame forFrame);
public override void UIRunJavaScriptAlertPanelMessage(WebView sender, string withMessage, WebFrame initiatedByFrame);
public override void ReceivedIcon(WebView sender, NSImage image, WebFrame forFrame);
public override bool UIRunJavaScriptConfirmationPanel(WebView sender, string withMessage, WebFrame initiatedByFrame);
public override void FailedLoadWithError(WebView sender, NSError error, WebFrame forFrame);
public override string UIRunJavaScriptTextInputPanelWithFrame(WebView sender, string prompt, string defaultText, WebFrame initiatedByFrame);
public override void WillPerformClientRedirect(WebView sender, NSUrl toUrl, double secondsDelay, NSDate fireDate, WebFrame forFrame);
public override bool UIRunBeforeUnload(WebView sender, string message, WebFrame initiatedByFrame);
public override void WillCloseFrame(WebView sender, WebFrame forFrame);
public override void StartedProvisionalLoad(WebView sender, WebFrame forFrame);
public override void DecidePolicyForNavigation(WebView webView, NSDictionary actionInformation, NSUrlRequest request, WebFrame frame, NSObject decisionToken);
public override void ReceivedServerRedirectForProvisionalLoad(WebView sender, WebFrame forFrame);
public override void UnableToImplementPolicy(WebView webView, NSError error, WebFrame frame);
public override void FailedProvisionalLoad(WebView sender, NSError error, WebFrame forFrame);
public override void DecidePolicyForNavigation(WebView web_view, NSDictionary action_info, NSUrlRequest request, WebFrame frame, NSObject decision_token) { string url = request.Url.ToString (); if (url.StartsWith (Path.VolumeSeparatorChar.ToString ())) { string file_path = request.Url.ToString (); file_path = file_path.Replace ("%20", " "); NSWorkspace.SharedWorkspace.OpenFile (file_path); } else { Regex regex = new Regex (@"(.+)~(.+)~(.+)"); Match match = regex.Match (url); if (match.Success) { string folder_name = match.Groups [1].Value; string revision = match.Groups [2].Value; string note = match.Groups [3].Value; Thread thread = new Thread (new ThreadStart (delegate { SparkleShare.Controller.AddNoteToFolder (folder_name, revision, note); })); thread.Start (); } } }
public void FinishedLoad(WebView sender, WebFrame forFrame) { FinishedLoading(); }