Is there a way for a privileged Firefox OS app to detect if the WiFi is connected to a network? I am aware of https://developer.mozilla.org/en-US/docs/WebAPI/Settings but that API is only for certified apps. All I need to do is detect whether the phone is connected to a network or is not connected.
You need to use the Network Info API, which provides you with values about the bandwidth
(Mb/s estimate) and if the current connection is metered
(mobile data vs Wifi).
metered
should be enough to tell if the user is on wifi. There is no need to read the Settings! This API is even accessible for web apps.