Ticket #3934: 0001-Don-t-show-error-page-when-plugin-will-handle.patch

File 0001-Don-t-show-error-page-when-plugin-will-handle.patch, 1.2 KB (added by humitos, 11 years ago)
  • browser.py

    From de12e016e88d9c8ed765ed1a0d4c0b73b4d2fc80 Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Tue, 30 Oct 2012 22:28:57 -0300
    Subject: [PATCH Browse] Don't show error page when plugin will handle
    
    Allow a plugin to handle the request without showing
    the error page.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    ---
     browser.py | 9 ++++++---
     1 file changed, 6 insertions(+), 3 deletions(-)
    
    diff --git a/browser.py b/browser.py
    index b0f4768..139a907 100644
    a b class Browser(WebKit.WebView): 
    650650        """Show Sugar's error page"""
    651651
    652652        # Don't show error page if the load was interrupted by policy
    653         # change. For example, if a file was requested for download
    654         if web_error.code == WebKit.PolicyError.\
    655                 FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE:
     653        # change or the request will be handled by a plugin. For
     654        # example, if a file was requested for download or an .ogg
     655        # file will be played
     656        if web_error.code in (WebKit.PolicyError.\
     657                FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE,
     658                WebKit.PluginError.WILL_HANDLE_LOAD):
    656659            return True
    657660
    658661        data = {