Esempio n. 1
0
 public void decidePolicyForNavigationAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
 {
     if (AllowNavigation || AllowInitialNavigation)
         listener.use();
     else
         listener.ignore();
 }
 public void decidePolicyForMIMEType(WebView WebView, string type, IWebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
 {
     if (WebView.canShowMIMEType(type) == 0 && !request.url().StartsWith("file:") && !type.Contains("pdf"))
     {
         if (AllowDownloads)
             listener.download();
         else
             listener.ignore();
     }
     else
     {
         listener.use();
         Owner.tempmimetype = type;
     }
 }
Esempio n. 3
0
 public void decidePolicyForMIMEType(WebView webView, string type, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
 {
     // todo: add support for showing custom MIME type documents
     // and for changing which MIME types are handled here
     if (webView.canShowMIMEType(type) == 0)
     {
         if (AllowDownloads)
             listener.download();
         else
             listener.ignore();
     }
     else
     {
         listener.use();
     }
 }
Esempio n. 4
0
        private void uiDelegate_CreateWebViewWithRequest(IWebURLRequest request, out WebView webView)
        {
            // TODO: find out why url seems to always be empty:
            // https://bugs.webkit.org/show_bug.cgi?id=41441 explains all
            string url = (request == null) ? "" : request.url();
            NewWindowRequestEventArgs args = new NewWindowRequestEventArgs(url);

            NewWindowRequest(this, args);

            if (!args.Cancel)
            {
                WebKitBrowserCore b = new WebKitBrowserCore(host);
                webView = (WebView)b.webView;
                NewWindowCreated(this, new NewWindowCreatedEventArgs(b));
            }
            else
            {
                webView = null;
            }
        }
 public void decidePolicyForMIMEType(WebView WebView, string type, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
 {
     // todo: add support for showing custom MIME type documents
     // and for changing which MIME types are handled here
     if (WebView.canShowMIMEType(type) == 0)
     {
         if (AllowDownloads)
         {
             listener.download();
         }
         else
         {
             listener.ignore();
         }
     }
     else
     {
         listener.use();
     }
 }
 public void decidePolicyForNewWindowAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, string frameName, IWebPolicyDecisionListener listener)
 {
     if (listener != null)
        listener.use();
     string url = request.url();
     NewWindowRequestUrlAvailable(url);
 }
Esempio n. 7
0
 public void decidePolicyForMIMEType(WebView webView, string type, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
 {
     listener.use();
 }
 public void identifierForInitialRequest(WebView WebView, IWebURLRequest request, IWebDataSource dataSource, uint identifier)
 {
     if (Owner.Preferences.IgnoreSSLErrors)
         request.mutableCopy().setAllowsAnyHTTPSCertificate();
 }
 public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
 {
     if (Owner.preferences.IgnoreSSLErrors)
         request.mutableCopy().setAllowsAnyHTTPSCertificate();
     return request; 
 }
 public IWebURLRequest willSendRequest(WebView WebView, uint identifier, IWebURLRequest request, IWebURLResponse redirectResponse, IWebDataSource dataSource)
 {
     string ret = ResourceRequestSent(request.url());
     if (Owner.Preferences.IgnoreSSLErrors)
         request.mutableCopy().setAllowsAnyHTTPSCertificate();
     if (string.IsNullOrEmpty(ret))
     {
         return null;
     }
     else
     {
         if (ret == request.url())
         {
             return request;
         }
         else
         {
             IWebURLRequest req = new WebURLRequestClass();
             req.initWithURL(ret, _WebURLRequestCachePolicy.WebURLRequestUseProtocolCachePolicy, 60);
             return req;
         }
     }
 }
Esempio n. 11
0
        private void uiDelegate_CreateWebViewWithRequest(IWebURLRequest request, out WebView webView)
        {
            // Todo: find out why url seems to always be empty
            string url = (request == null) ? "" : request.url();
            NewWindowRequestEventArgs args = new NewWindowRequestEventArgs(url);
            NewWindowRequest(this, args);

            if (!args.Cancel)
            {
                WebKitBrowser b = new WebKitBrowser();
                webView = (WebView) b.webView;
                NewWindowCreated(this, new NewWindowCreatedEventArgs(b));
            }
            else
            {
                webView = null;
            }
        }
Esempio n. 12
0
 public void decidePolicyForNavigationAction(WebView webView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, IWebFrame frame, IWebPolicyDecisionListener listener)
 {
     listener.use();
 }
 public WebView createModalDialog(WebView sender, IWebURLRequest request)
 {
     throw new NotImplementedException();
 }
Esempio n. 14
0
 public void decidePolicyForNewWindowAction(WebView webView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, string frameName, IWebPolicyDecisionListener listener)
 {
     if (AllowNewWindows)
         listener.use();
     else
         listener.ignore();
 }
 public IWebURLRequest willSendRequest(WebView webView, uint identifier, IWebURLRequest request, WebURLResponse redirectResponse, IWebDataSource dataSource)
 {
     throw new NotImplementedException();
 }
 public void identifierForInitialRequest(WebView webView, IWebURLRequest request, IWebDataSource dataSource, uint identifier)
 {
     throw new NotImplementedException();
 }
 public void identifierForInitialRequest(WebView webView, IWebURLRequest request, IWebDataSource dataSource, uint identifier)
 {
     throw new NotImplementedException();
 }
        public void decidePolicyForNavigationAction(WebView WebView, CFDictionaryPropertyBag actionInformation, IWebURLRequest request, webFrame frame, IWebPolicyDecisionListener listener)
        {
            if (AllowNavigation || AllowInitialNavigation)
            {
                //use basic authentication if username and password are supplied.
                if (pwdEnabled && string.IsNullOrEmpty(request.valueForHTTPHeaderField("Authorization")) && wbc!=null)
                {

                    wbc.Navigate(request.url());
                    listener.ignore();
                    return;
                }

                listener.use();
            }
            else
                listener.ignore();
        }
Esempio n. 19
0
        private void uiDelegate_CreateWebViewWithRequest(IWebURLRequest request, out WebView webView)
        {
            // TODO: find out why url seems to always be empty:
            // https://bugs.webkit.org/show_bug.cgi?id=41441 explains all
            string url = (request == null) ? "" : request.url();
            NewWindowRequestEventArgs args = new NewWindowRequestEventArgs(url);
            NewWindowRequest(this, args);

            if (!args.Cancel)
            {
                WebKitBrowserCore b = new WebKitBrowserCore(host);
                webView = (WebView) b.webView;
                NewWindowCreated(this, new NewWindowCreatedEventArgs(b));
            }
            else
            {
                webView = null;
            }
        }
Esempio n. 20
0
 private void uiDelegate_CreateWebViewWithRequest(IWebURLRequest request, out WebView webView, bool popup = false)
 {
     WebKitBrowser b = new WebKitBrowser();
     if (request != null)
     {
         if (!string.IsNullOrEmpty(request.url()))
             b.Navigate(request.url());
     }
     webView = (WebView) b.webView;
     string url = newwindowurl;
     if (string.IsNullOrEmpty(newwindowurl) && request != null)
         url = request.url();
     
     NewWindowRequestEventArgs args = new NewWindowRequestEventArgs(url);
     if (popup == true)
     {
         PopupCreated(this, new NewWindowCreatedEventArgs(b));
     }
     else
     {
         NewWindowRequest(this, args);
         NewWindowCreated(this, new NewWindowCreatedEventArgs(b));
     }
     //if (this.Focused == false || ElementAtPoint(this.PointToClient(Cursor.Current.HotSpot)).Type == ElementType.Body || (GetCurrentElement().Type != ElementType.LinkOrUknown || GetCurrentElement().TagName == "BODY" || GetCurrentElement().TagName == "IFRAME" || GetCurrentElement() == null && GetCurrentElement().TagName != "OBJECT"))
     //    {
     //        PopupCreated(this, new NewWindowCreatedEventArgs(b));
     //    }
     //    else
     //    {
     //        NewWindowRequest(this, args);
     //        NewWindowCreated(this, new NewWindowCreatedEventArgs(b));
     //    }
 }
Esempio n. 21
0
 public WebView createWebViewWithRequest(WebView sender, IWebURLRequest request, CFDictionaryPropertyBag windowFeatures)
 {
     if (owner.AllowNewWindows)
     {
         WebView view;
         CreateWebViewWithRequest(request, out view, true);
         return view;
     }
     else
     {
         return null;
     }
 }
 public WebView createWebViewWithRequest(WebView sender, IWebURLRequest request)
 {
     // this should be caught in the WebPolicyDelegate, but isn't in the Cairo build
     if (owner.AllowNewWindows)
     {
         WebView view;
         CreateWebViewWithRequest(request, out view);
         return view;
     }
     else
     {
         return null;
     }
 }
Esempio n. 23
0
 public WebView createWebViewWithRequest(WebView sender, IWebURLRequest request)
 {
     if (owner.AllowNewWindows)
     {
         WebView view;
         CreateWebViewWithRequest(request, out view);
         return view;
     }
     else
     {
         return null;
     }
 }