Previously, the Chrome Extension Show My IP has been both accepted by utopian.io and Chrome Webstore. Today I have spent some time adding support for using ipify API to get the IP Address. Therefore, the chrome extension supports 5 API servers which makes it more robust.
Chrome Webstore: https://chrome.google.com/webstore/detail/show-my-ip-addresses-exte/opljiobgnagdjikipnagigiacllolpaj
Github: https://github.com/DoctorLai/what-is-my-ip
This commit: https://github.com/DoctorLai/what-is-my-ip/commit/13a5fc8b9074651d36573bae061ae6ed6896134e#diff-77a711c4c2c9fd1e7125ed653dc9e3ab
The code:
function callThirdParty(server, name) {
var api = server;
logit("Connecting " + server + " ...");
$.ajax({
type: "GET",
url: api,
success: function(data) {
if (data && data['ip']) {
current_ip = data['ip'];
$('pre#ip').append(current_ip + "\n");
}
},
error: function(request, status, error) {
logit('Response: ' + request.responseText);
logit('Error: ' + error );
logit('Status: ' + status);
},
complete: function(data) {
logit('API Finished: ' + name + " Server!");
}
});
}
document.addEventListener('DOMContentLoaded', function() {
getLocalIPs(function(ips) { //