magnetometerThe magnetometer directive controls whether the Generic Sensor API's Magnetometer interface may read the ambient magnetic field in microteslas (µT). Its default allowlist is self, and it powers compass and heading features.
`magnetometer=(self)` limits it to the document's own origin, `magnetometer=()` blocks it entirely, and `magnetometer=(self "https://compass.example.com")` delegates to a named origin. An iframe needs `allow="magnetometer"`, and it is delegated alongside accelerometer and gyroscope in 3D/AR embeds that need heading computation.
When the policy denies it, a sensor created with new Magnetometer() emits an error event on activation and provides no readings. Like other motion sensors, the magnetic-field signal carries fingerprinting and side-channel concerns, so it works only in a secure context and the browser may require additional permission. It is an experimental feature with thin browser support and replaces the legacy Feature-Policy feature.
Permissions-Policy: magnetometer=(self)