-
Notifications
You must be signed in to change notification settings - Fork 4
/
harness.html
46 lines (40 loc) · 1.83 KB
/
harness.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html style="height:100%">
<head>
<title></title>
</head>
<body style="height:100%">
<iframe id="testFrame" style="width: 100%; height: 100%; position: absolute; top: 0; left: 0; border: none"></iframe>
<script type="text/javascript">
(function(){
function parseQuery() {
if(location.href.indexOf('?') < 0){
return {};
}
var qs = location.href.substring(location.href.indexOf('?') + 1);
var query = {};
var split = qs.split('&');
for(var i = 0; i < split.length; i++) {
var kvp = split[i].split('=');
query[decodeURIComponent(kvp[0])] = decodeURIComponent(kvp[1]);
}
return query;
}
function getBaseURL () {
return location.protocol + "//" + location.hostname;
}
var query = parseQuery();
var host = query.host || (getBaseURL() + ':4500');
if(host.indexOf('://') < 0){
host = 'http://' + host;
}
var harnessHost = window.harnessHost = host;
document.write('<scr' + 'ipt type="text/javascript" src="' + harnessHost + '/vendor/jquery.js"></scr' + 'ipt>');
document.write('<scr' + 'ipt type="text/javascript" src="' + harnessHost + '/vendor/jquery.cookie.js"></scr' + 'ipt>');
document.write('<scr' + 'ipt type="text/javascript" src="' + harnessHost + '/vendor/augment.js"></scr' + 'ipt>');
document.write('<scr' + 'ipt type="text/javascript" src="' + harnessHost + '/nowjs/now.js"></scr' + 'ipt>');
document.write('<scr' + 'ipt type="text/javascript" src="' + harnessHost + '/client.js"></scr' + 'ipt>');
})();
</script>
</body>
</html>