Handling Smartphone Events

Touch and pen input arrive as pointer and touch events (Touch Events and Pointer Events), and deviceorientation and devicemotion report sensors over HTTPS (Sensors). For rotation, listen for change on screen.orientation, Baseline since March 2023, instead of the deprecated orientationchange:

Reacting to rotationJavaScript
screen.orientation.addEventListener("change", () => {
  document.body.dataset.orientation = screen.orientation.type;   // e.g. "landscape-primary"
});

Battery events (levelchange, chargingchange) are not Baseline, and the call, SMS and smart-card events of Firefox 555 OS vanished with that platform.