Can I get the device's WiFi or host name, local IP or other device identifier?

This is platform independent. It will show when you run the JavaScript I attached instead of the local IP address but if you disable the option I showed you and run the script again, you will see the local IP address.