Bug 1377355 - Unable to load unpacked web extensions in about:debugging; content script cannot be loaded; r?jimm draft
authorHaik Aftandilian <haftandilian@mozilla.com>
Fri, 30 Jun 2017 12:36:00 -0700
changeset 602808 5a6762f741688ec7ed7e2d7e30218ce0fe75d517
parent 602807 62a2295f0808646bd33fc6db32b7c60ab8d7f275
child 635721 e98ad35db9b18b919e3c8d9e6c41d6a38bc9825d
push id66559
push userhaftandilian@mozilla.com
push dateFri, 30 Jun 2017 19:37:31 +0000
reviewersjimm
bugs1377355
milestone56.0a1
Bug 1377355 - Unable to load unpacked web extensions in about:debugging; content script cannot be loaded; r?jimm MozReview-Commit-ID: 7aI6dJsRJtP
netwerk/protocol/res/ExtensionProtocolHandler.cpp
--- a/netwerk/protocol/res/ExtensionProtocolHandler.cpp
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.cpp
@@ -14,17 +14,16 @@
 #include "mozilla/ipc/URIParams.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/RefPtr.h"
 
 #include "FileDescriptor.h"
 #include "FileDescriptorFile.h"
 #include "LoadInfo.h"
-#include "nsContentUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIFile.h"
 #include "nsIFileChannel.h"
 #include "nsIFileStreams.h"
 #include "nsIFileURL.h"
 #include "nsIJARChannel.h"
 #include "nsIURL.h"
 #include "nsIChannel.h"
@@ -553,22 +552,16 @@ ExtensionProtocolHandler::NewStream(nsIU
     return Err(NS_ERROR_FILE_NOT_DIRECTORY);
   }
 
   /*
    * Now get a channel for the resolved child URI and make sure the
    * channel is a file channel.
    */
 
-  nsCOMPtr<nsIPrincipal> childPrincipal;
-  NS_TRY(aChildLoadInfo->GetLoadingPrincipal(getter_AddRefs(childPrincipal)));
-  if (nsContentUtils::IsSystemPrincipal(childPrincipal)) {
-    return Err(NS_ERROR_FILE_ACCESS_DENIED);
-  }
-
   nsCOMPtr<nsIChannel> channel;
   NS_TRY(NS_NewChannelInternal(getter_AddRefs(channel),
                                aChildURI,
                                aChildLoadInfo));
 
   // Channel should be a file channel. It should never be a JAR
   // channel because we only request remote streams for unpacked
   // extension resource loads where the URI resolves to a file.