Bug 1368102: Part 2 - Add WebExtensionContentScript bindings. r=billm,mixedpuppy

Bill, can you please review the binding code? Shane and zombie, can you please
review the content script matching?

MozReview-Commit-ID: IJB5s0a7r7S
This commit is contained in:
Kris Maglione
2017-06-03 22:03:19 -07:00
parent 29d72d873d
commit eb1e83769a
16 changed files with 793 additions and 5 deletions

View File

@@ -185,10 +185,16 @@ bool
URLInfo::InheritsPrincipal() const
{
if (!mInheritsPrincipal.isSome()) {
bool inherits = false;
nsresult rv = NS_URIChainHasFlags(mURI, nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT,
&inherits);
Unused << NS_WARN_IF(NS_FAILED(rv));
// For our purposes, about:blank and about:srcdoc are treated as URIs that
// inherit principals.
bool inherits = Spec().EqualsLiteral("about:blank") || Spec().EqualsLiteral("about:srcdoc");
if (!inherits) {
nsresult rv = NS_URIChainHasFlags(mURI, nsIProtocolHandler::URI_INHERITS_SECURITY_CONTEXT,
&inherits);
Unused << NS_WARN_IF(NS_FAILED(rv));
}
mInheritsPrincipal.emplace(inherits);
}
return mInheritsPrincipal.ref();