To determine ipv4/6, do you need to send that hostname and ip off to somewhere to get a response? or can it be done locally without leaving the machine?
It's local. The webRequest API provides an 'ip' field with each request, and the hostname can be extracted from the URL. Once you have an IP address, just check for colons.
IPv4: 123.123.123.123
IPv6: 2001:db8::8a2e:370:7334
https://developer.chrome.com/docs/extensions/reference/api/w...