Omegle IP to location and Watermark Remove

Shows IP, country, state, city, district, local time, and ISP. Also removes omegle watermark from stranger's video.

  1. // ==UserScript==
  2. // @name Omegle IP to location and Watermark Remove
  3. // @description Shows IP, country, state, city, district, local time, and ISP. Also removes omegle watermark from stranger's video.
  4. // @version 1.0
  5. // @match https://omegle.com/*
  6. // @match https://www.omegle.com/*
  7. // @grant none
  8. // @run-at document-end
  9. // @namespace https://greasyfork.org/users/789058
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. const apiService = "ipinfo" // must be "ipinfo" or "ipapi"
  14. const apiKey = "" // gets better results with ipinfo, and does nothing for ip-api
  15. var tested = [];
  16. if (localStorage.getItem('tests') !== null) {
  17. tested = JSON.parse(localStorage.getItem('tests'));
  18. }
  19. var session = 0;
  20. var lastQuery = Date.now();
  21. window.oRTCPeerConnection = window.oRTCPeerConnection || window.RTCPeerConnection;
  22. window.RTCPeerConnection = function (...args) {
  23. const pc = new window.oRTCPeerConnection(...args);
  24. pc.oaddIceCandidate = pc.addIceCandidate;
  25. pc.addIceCandidate = function (iceCandidate, ...rest) {
  26. if (document.getElementById('videologo') instanceof Object) {
  27. document.getElementById('videologo').remove();
  28. }
  29. const fields = iceCandidate.candidate.split(' ');
  30. const ip = fields[4];
  31. if (fields[7] === 'srflx') {
  32. for (var i of tested) {
  33. if (i.query == ip) {
  34. makeTable(i);
  35. }
  36. }
  37. if (document.getElementsByTagName('table').length < 2 & lastQuery+1000 < Date.now()) {
  38. getLocation(ip);
  39. }
  40. }
  41. console.log(tested.length + ' - ' + ip);
  42. return pc.oaddIceCandidate(iceCandidate, ...rest);
  43. };
  44. return pc;
  45. };
  46. function getLocation(ip) {
  47. lastQuery = Date.now();
  48. var endpoint = `https://ipinfo.io/${ip}/json?token=${apiKey}`;
  49. if (apiService == "ipapi") {
  50. endpoint = `http://ip-api.com/json/${ip}?fields=18561529`;
  51. }
  52. var xhr = new XMLHttpRequest();
  53. xhr.onreadystatechange = function() {
  54. if (this.readyState == 4 && this.status == 200) {
  55. var response = JSON.parse(this.responseText);
  56. response.timezone = new Intl.DateTimeFormat([],{timeZone:response.timezone,year:'numeric',month:'numeric',day:'numeric',hour:'numeric',minute:'numeric',second:'numeric'}).format(new Date());
  57. response.total = tested.length;
  58. tested.push(response);
  59. localStorage.setItem('tests',JSON.stringify(tested));
  60. makeTable(response);
  61. }
  62. };
  63. xhr.open('GET', endpoint, true);
  64. xhr.send();
  65. }
  66. function makeTable(json) {
  67. session ++;
  68. json.session = session;
  69. var table = '<table border="2px">';
  70. for (const thing in json) {
  71. table += `<tr><td>${thing.charAt(0).toUpperCase()+thing.substring(1)}</td><td>${json[thing]}</td></tr>`;
  72. }
  73. table += '</table>';
  74. document.getElementsByClassName('statuslog')[0].innerHTML = table;
  75. }