diff --git a/dom/system/nsDeviceSensors.cpp b/dom/system/nsDeviceSensors.cpp index cfd59b05bf5b..3c356b7489d3 100644 --- a/dom/system/nsDeviceSensors.cpp +++ b/dom/system/nsDeviceSensors.cpp @@ -572,5 +572,7 @@ bool nsDeviceSensors::IsSensorAllowedByPref(uint32_t aType, return true; } - return !nsContentUtils::ShouldResistFingerprinting(window->GetDocShell()); + nsCOMPtr soPrincipal = do_QueryInterface(window); + return !nsContentUtils::ShouldResistFingerprinting( + soPrincipal->GetPrincipal()); }