I'm working on a website that needs to change settings when a user's device changes from retina to non-retina or vice-versa. Is there a JavaScript event that fires when users plug into or unplug from external devices?
I could imagine polling window.devicePixelRatio
and listening for changes but I'd prefer something that's "lazier" and only triggers when the device pixel ratio changes. Any suggestions others have on how best to achieve this would be welcome!