Bug 1581084, nsDeviceSensors::IsSensorAllowedByPref should use the principal of the window, not docshell, to check whether to resist fingerprinting, r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D50525

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Olli Pettay 2019-11-04 12:43:43 +00:00
parent 5ea71911af
commit c1bb23c9ad

View File

@ -572,5 +572,7 @@ bool nsDeviceSensors::IsSensorAllowedByPref(uint32_t aType,
return true;
}
return !nsContentUtils::ShouldResistFingerprinting(window->GetDocShell());
nsCOMPtr<nsIScriptObjectPrincipal> soPrincipal = do_QueryInterface(window);
return !nsContentUtils::ShouldResistFingerprinting(
soPrincipal->GetPrincipal());
}