Bug 1653541 - always allow webextensions to navigate to external protocol URIs, r=robwu

Differential Revision: https://phabricator.services.mozilla.com/D84179
This commit is contained in:
Gijs Kruitbosch 2020-07-20 21:48:21 +00:00
parent b58a9a8eca
commit 6b51f8bd70

View File

@ -977,6 +977,9 @@ nsExternalHelperAppService::LoadURI(nsIURI* aURI,
// from otherwise disjoint browsingcontext trees.
if (aBrowsingContext && aTriggeringPrincipal &&
!StaticPrefs::security_allow_disjointed_external_uri_loads() &&
// Add-on principals are always allowed:
!BasePrincipal::Cast(aTriggeringPrincipal)->AddonPolicy() &&
// As is chrome code:
!aTriggeringPrincipal->IsSystemPrincipal()) {
RefPtr<BrowsingContext> bc = aBrowsingContext;
WindowGlobalParent* wgp = bc->Canonical()->GetCurrentWindowGlobal();