From 369e3223776afb76cb9cc11483bfe40cc2a55d0c Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Mon, 01 Oct 2012 20:35:07 +0000 Subject: 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 Acked-by: Manuel QuiƱones --- (limited to 'browser.py') diff --git a/browser.py b/browser.py index fb8a985..4488580 100644 --- a/browser.py +++ b/browser.py @@ -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'), -- cgit v0.9.1