HEX
Server: Apache/2.2.34 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141
System: Linux Kou-Etsu-Dou 4.4.59+ #25556 SMP PREEMPT Thu Mar 4 18:03:46 CST 2021 x86_64
User: hosam (1026)
PHP: 7.2.29
Disabled: NONE
Upload Files
File: //usr/syno/synoman/webman/detector.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
var Detector = (function() {
	var found = false;
	var total = 0;
	var origin = location.protocol + '//' + location.host;
	function create_load_callback(url) {
		return function() {
			if (!found) {
				found = true;
				parent.postMessage({success: true, url: url}, origin);
			}
		};
	}
	function create_error_callback() {
		return function() {
			if (--total === 0) {
				parent.postMessage({success: false}, origin);
			}
		};
	}
	function process(request) {
		total = request.data.url.length;
		request.data.url.forEach(function(url) {
			if (!found) {
				var img = new Image();
				img.onload = create_load_callback(url);
				img.onerror = create_error_callback();
				img.src = url + request.data.img_path;
			}
		});
	}
	function init() {
		window.addEventListener('message', function(request) {
			try {
				process(request);
			} catch(e) {
				if (!found) {
					parent.postMessage({success: false, error: e}, origin);
				}
			}
		});
	}
	return { 'init': init };
}());
</script>
</head>
<body onload="Detector.init()">
</body>
</html>