diff options
author | Manuel Kaufmann <humitos@gmail.com> | 2012-10-01 20:35:07 (GMT) |
---|---|---|
committer | Manuel QuiƱones <manuq@laptop.org> | 2012-10-02 04:38:59 (GMT) |
commit | 369e3223776afb76cb9cc11483bfe40cc2a55d0c (patch) | |
tree | f89b19787426f0851d233f625fb4352415d98749 /browser.py | |
parent | 68a59b0e61760456dc6f1ea00d808f1cba3a56e7 (diff) |
Handle LoadInterruptedByPolicyChange SL #3972
This error is raised when the mimetype policy suffers a change. When
this happens __load_error_cb is called and we were showing the error
page in any case.
With this patch that case is properly handled in __load_error_cb and
the error page is not shown on the current tab. In fact, we keep the
same page where the user clicked the link in the tab.
Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'browser.py')
-rw-r--r-- | browser.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -643,6 +643,12 @@ class Browser(WebKit.WebView): def __load_error_cb(self, web_view, web_frame, uri, web_error): """Show Sugar's error page""" + # Don't show error page if the load was interrupted by policy + # change. For example, if a file was requested for download + if web_error.code == WebKit.PolicyError.\ + FRAME_LOAD_INTERRUPTED_BY_POLICY_CHANGE: + return True + data = { 'page_title': _('This web page could not be loaded'), 'title': _('This web page could not be loaded'), |