PageSourceSearch

https://www.whatsmyip.org/js/pages/homepage.js

js whatsmyip.org collected 2026-10-01 08:29:32 UTC 1,223 bytes, 40 lines download raw bytes

1
2window.addEventListener("load",function()
3	{
4	// Hide 'Add to Home Screen' Message
5	if ( document.getElementById("add-to-homescreen-msg") )
6		{
7		var isInWebAppiOS = (window.navigator.standalone === true);
8		var isInWebAppChrome = (window.matchMedia('(display-mode: standalone)').matches);
9
10		if (!isInWebAppiOS && !isInWebAppChrome)
11			{
12			document.getElementById("add-to-homescreen-msg").style.display = "block";
13			}
14		}
15	
16	// Mark Navigation
17	if ( document.getElementById("hme") )
18		{ document.getElementById("hme").classList.add("this_page"); }
19	
20	// Copy IP Address
21	if (navigator.clipboard)
22		{
23		document.getElementById("copyip").addEventListener("click",function($event)
24			{
25			var $users_ip = document.getElementById("ip").innerHTML;
26			if (window.confirm("Copy IP Address " + $users_ip + " to your clipboard?"))
27				{
28			    var $end_time = Date.now() + 500;
29			    while ( Date.now() < $end_time )
30    				{ }
31    			// Maybe replace the above mess with https://jsfiddle.net/l008com/8xj6osn4/8/
32    			// <dialog> not widely supported. Keep sketchy timer above or make a custom
33    			// dialog message on all three platforms. 
34    			
35				navigator.clipboard.writeText($users_ip);			
36				}
37			});
38		}
39	});
40

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.