Skip to content

Commit

Permalink
Switched back to freegeoip
Browse files Browse the repository at this point in the history
  • Loading branch information
ToX82 committed Dec 10, 2015
1 parent 9e39b44 commit 3a59279
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cookiebar-latest.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin URL: http://cookie-bar.eu/
@author: Emanuele "ToX" Toscano
@description: Cookie Bar is a free & simple solution to the EU cookie law.
@version: 1.5.4
@version: 1.5.5
*/

/*
Expand Down Expand Up @@ -85,7 +85,7 @@ function setupCookieBar() {
*/
var checkEurope = new XMLHttpRequest();

checkEurope.open('GET', '//www.telize.com/geoip', true);
checkEurope.open('GET', '//freegeoip.net/json/', true);
checkEurope.onreadystatechange = function() {
if (checkEurope.readyState === 4 && checkEurope.status === 200) {
clearTimeout(xmlHttpTimeout);
Expand Down Expand Up @@ -114,14 +114,14 @@ function setupCookieBar() {

/*
* Using an external service for geoip localization could be a long task
* If it takes more than 1 second, start normally
* If it takes more than 1.5 second, start normally
* @param null
* @return null
*/
var xmlHttpTimeout = setTimeout(ajaxTimeout, 1500);
function ajaxTimeout() {
checkEurope.abort();
console.log('cookieBAR - Timeout for ip geolocalion');
console.log('cookieBAR - Timeout for ip geolocation');

if (document.cookie.length > 0 || window.localStorage.length > 0) {
var accepted = getCookie();
Expand Down
2 changes: 1 addition & 1 deletion cookiebar-latest.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3a59279

Please sign in to comment.