Bug 1565606 - Remove remote disco pane support from nsDocShell.cpp r?gijs draft
authorMark Striemer <mstriemer@mozilla.com>
Thu, 05 Dec 2019 18:35:24 +0000
changeset 2519007 aae5fd0db93fcb19ae01a9c34fb91398aab27965
parent 2519006 88a7afedd3d162d4b3e6ae76caa2ae8994189676
child 2519008 a6298ea109fd5a0aad0370dd19482bbbd9266680
push id460997
push userreviewbot
push dateThu, 05 Dec 2019 18:35:47 +0000
treeherdertry@8e21da253cd0 [default view] [failures only]
reviewersgijs
bugs1565606
milestone72.0a1
Bug 1565606 - Remove remote disco pane support from nsDocShell.cpp r?gijs Differential Revision: https://phabricator.services.mozilla.com/D55720 Differential Diff: PHID-DIFF-tbzavtxzsgiiteki4zwz
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -9197,50 +9197,16 @@ nsresult nsDocShell::InternalLoad(nsDocS
       nsAutoCString scheme;
       uri->GetScheme(scheme);
       // Allow ext+foo URIs (extension-registered custom protocols). See
       // https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/protocol_handlers
       if (StringBeginsWith(scheme, NS_LITERAL_CSTRING("ext+")) &&
           !StaticPrefs::extensions_webextensions_remote()) {
         break;
       }
-      // This next bit is... awful. Basically, about:addons used to load the
-      // discovery pane remotely. Allow for that, if that's actually the state
-      // we're in (which is no longer the default at time of writing, but still
-      // tested). https://bugzilla.mozilla.org/show_bug.cgi?id=1565606 covers
-      // removing this atrocity.
-      nsCOMPtr<nsIWebNavigation> parent(do_QueryInterface(mParent));
-      if (parent) {
-        nsCOMPtr<nsIURI> parentURL;
-        parent->GetCurrentURI(getter_AddRefs(parentURL));
-        if (parentURL &&
-            parentURL->GetSpecOrDefault().EqualsLiteral("about:addons") &&
-            (!Preferences::GetBool("extensions.htmlaboutaddons.enabled",
-                                   true) ||
-             !Preferences::GetBool(
-                 "extensions.htmlaboutaddons.discover.enabled", true))) {
-          nsCString discoveryURLString;
-          Preferences::GetCString("extensions.webservice.discoverURL",
-                                  discoveryURLString);
-          nsCOMPtr<nsIURI> discoveryURL;
-          NS_NewURI(getter_AddRefs(discoveryURL), discoveryURLString);
-
-          nsAutoCString discoveryPrePath;
-          if (discoveryURL) {
-            discoveryURL->GetPrePath(discoveryPrePath);
-          }
-
-          nsAutoCString requestedPrePath;
-          uri->GetPrePath(requestedPrePath);
-          // So allow the discovery path to load inside about:addons.
-          if (discoveryPrePath.Equals(requestedPrePath)) {
-            break;
-          }
-        }
-      }
       // Final exception for some legacy automated tests:
       if (xpc::IsInAutomation() &&
           Preferences::GetBool("security.allow_unsafe_parent_loads", false)) {
         break;
       }
       return NS_ERROR_FAILURE;
     } while (0);
   }