The page asks for the user's location, camera, microphone or permission to notify

tx0/ts:asks-device-permissionstrictwarningsecurity/authn-authzdepth fastsecurity

What it finds

Location, camera, microphone and notifications are powerful permissions. Asking for them, especially on load and not in reply to a user's action, is intrusive, gets denied and, once granted, exposes sensitive data to every script of the page.

Reported are calls of getCurrentPosition and watchPosition on navigator.geolocation, getUserMedia and getDisplayMedia on navigator.mediaDevices, and Notification.requestPermission.

From the rule's source, asks_device_permission.rs.

Example from the rule's tests
export function locate(done: (p: GeolocationPosition) => void) {  navigator.geolocation.getCurrentPosition(done);tx0 reports: this asks for the user's location}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:asks-device-permission" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/ts:asks-device-permission] reason="..."

tx0 explain tx0/ts:asks-device-permission shows the same in the terminal. Found a false positive? Report it.