[tbb-commits] [tor-browser/tor-browser-60.3.0esr-8.0-1] Bug 680300 - Part 1: Stopping reporting errors when loading an unknown external protocol. r=smaug

gk at torproject.org gk at torproject.org
Wed Dec 5 07:52:24 UTC 2018


commit d0571f8b98a5a98e59974b4868c0fcccaea17748
Author: Tim Huang <tihuang at mozilla.com>
Date:   Tue Sep 25 07:50:28 2018 +0000

    Bug 680300 - Part 1: Stopping reporting errors when loading an unknown external protocol. r=smaug
    
    This patch makes the docshell not to report an error if it is a unknown
    protocol error. However, we will still display the error page in this
    case.
    
    Differential Revision: https://phabricator.services.mozilla.com/D3492
    
    --HG--
    extra : moz-landing-system : lando
---
 docshell/base/nsDocShell.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 120b8c8b880b..e95855dd3e9f 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -10486,6 +10486,13 @@ nsDocShell::InternalLoad(nsIURI* aURI,
         (aFlags & LOAD_FLAGS_ERROR_LOAD_CHANGES_RV) != 0) {
       return NS_ERROR_LOAD_SHOWED_ERRORPAGE;
     }
+
+    // We won't report any error if this is an unknown protocol error. The reason
+    // behind this is that it will allow enumeration of external protocols if
+    // we report an error for each unknown protocol.
+    if (NS_ERROR_UNKNOWN_PROTOCOL == rv) {
+      return NS_OK;
+    }
   }
 
   return rv;





More information about the tbb-commits mailing list