Can javascript get the SSID of the current WiFi connection?

I need to get the SSID of the currently connected WiFi network (if it's Wi-Fi). Is it possible?

Here I saw something ( http://www.w3.org/TR/system-info-api/#network ), but I can not get the code to work. Is there a library that I need to import or is it just planned implementations?

I am writing a phonegap application and should know if I have to connect to the server locally or if I need to go remotely.

thanks

+4
source share
2 answers

It is not possible from now on. However, PhoneGap allows you to create plugins that will perform this task.

There is currently one available from HondaDai under the MIT license located at https://github.com/HondaDai/PhoneGap-WifiInfoPlugin .

** and it works great. After I figured out how it works. His example on how to get the SSID that shows wifi.SSID as a variable is incorrect. This is really wifi.activity.SSID, since there are two JSON objects in the return, and I wanted to access the same header activity.

+1
source

Poodimizer is right. If you need iOS support, I forked the WifiWizard. See: https://github.com/makeroo/WifiWizard

Although only getCurrentSSID is supported due to Apple restrictions.

+1
source

Source: https://habr.com/ru/post/1492339/


All Articles