Bug 1431371 Only grant activeTab to urls that match <all_urls> r=kmag

MozReview-Commit-ID: ApnAwGsIOaG
This commit is contained in:
Andrew Swan
2018-01-26 19:54:34 -08:00
parent c77e552eeb
commit b80ff2efef
3 changed files with 15 additions and 2 deletions

View File

@@ -486,6 +486,12 @@ MatchPattern::WrapObject(JSContext* aCx, JS::HandleObject aGivenProto)
return MatchPatternBinding::Wrap(aCx, this, aGivenProto);
}
/* static */ bool
MatchPattern::MatchesAllURLs(const URLInfo& aURL)
{
RefPtr<AtomSet> permittedSchemes = AtomSet::Get<PERMITTED_SCHEMES>();
return permittedSchemes->Contains(aURL.Scheme());
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(MatchPattern, mPath, mParent)