Created
April 11, 2010 17:35
-
-
Save matthewbauer/362904 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Geolocation support for Uzbl | |
navigator.geolocation = {}; | |
navigator.geolocation.getCurrentPosition = function(success, error){ | |
if ( Uzbl.run("sh 'zenity --question --text \'This website, " + location.href + ", wants to access your location. Do you want me to give it to them?\'; echo $?'") == '0' ){ | |
success(Uzbl.run("sh 'geoiplookup $(curl -s icanhazip.com) | sed -rn \'s/GeoIP City Edition, Rev 1: [^,]*, [^,]*, [^,]*, [^,]*, ([^,]*), ([^,]*), [^,]*, [^,]*/\1 \2/p\''")); | |
} else { | |
error(); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment