Bug 1456485: Part 2 - Allow extensions with the mozillaAddons permission to match restricted schemes. r=zombie
The schema handling for this is currently a bit ugly, for the sake of simplifying uplift. In the figure, we should find a way to change the schema pattern matching based on whether or not the extension is privileged. MozReview-Commit-ID: CU9WR2Ika6k
This commit is contained in:
@@ -449,6 +449,7 @@ WebExtensionContentScript::WebExtensionContentScript(WebExtensionPolicy& aExtens
|
||||
ErrorResult& aRv)
|
||||
: mExtension(&aExtension)
|
||||
, mHasActiveTabPermission(aInit.mHasActiveTabPermission)
|
||||
, mRestricted(!aExtension.HasPermission(nsGkAtoms::mozillaAddons))
|
||||
, mMatches(aInit.mMatches)
|
||||
, mExcludeMatches(aInit.mExcludeMatches)
|
||||
, mCssPaths(aInit.mCssPaths)
|
||||
@@ -493,7 +494,7 @@ WebExtensionContentScript::Matches(const DocInfo& aDoc) const
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mExtension->IsRestrictedDoc(aDoc)) {
|
||||
if (mRestricted && mExtension->IsRestrictedDoc(aDoc)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -525,7 +526,7 @@ WebExtensionContentScript::MatchesURI(const URLInfo& aURL) const
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mExtension->IsRestrictedURI(aURL)) {
|
||||
if (mRestricted && mExtension->IsRestrictedURI(aURL)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user