Bug 1377355 - Unable to load unpacked web extensions in about:debugging; content script cannot be loaded; r?jimm
Remove the system principal check for unpacked (development) moz-extension loads
and rely on the existing host, scheme, and filesystem checks.
MozReview-Commit-ID: 7aI6dJsRJtP
--- 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.