Skip to content

Instantly share code, notes, and snippets.

@mccombs
Created September 13, 2024 13:55
Show Gist options
  • Save mccombs/f9d97b9a3221fc6e0bd6564f7a82e121 to your computer and use it in GitHub Desktop.
Save mccombs/f9d97b9a3221fc6e0bd6564f7a82e121 to your computer and use it in GitHub Desktop.
PingPong
<script lang="js" defer>
let referrer = document.referrer;
let location = window.location;
let userAgent = navigator.userAgent;
let userAgentData = navigator.userAgentData;
console.log(location, userAgent, userAgentData);
let person = {
referrer: referrer,
location: location,
ua: navigator.userAgent,
uad: navigator.userAgentData,
};
await fetch("https://api.ipify.org?format=json").then((res) => {
res.json().then((data) => {
person.ip = data.ip;
});
});
console.log(person);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment