forked from janodvarko/harviewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloader.php
91 lines (85 loc) · 2.55 KB
/
loader.php
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HAR Viewer - Service Loader</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
body {
overflow-y:auto;
background-color: rgb(240, 243, 244);
margin: 0;
padding: 0;
font-size: 10px;
font-family: Lucida Grande,Tahoma,sans-serif;
}
#content {
width:100%;
}
#content td {
vertical-align:middle;
text-align:center;
}
#fullPreview {
font-size: 10px;
text-decoration:none;
}
#loadButton {
margin-bottom: 10px;
}
</style>
</head>
<body onload="onPageLoad()">
<!-- Initial content of the loader is a button that must be clicked to get
the HAR service. -->
<table id="content" version="@VERSION@" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<button id="loadButton" onclick="onHARLoad()">Load HAR</button>
<br/>
<a id="fullPreview" target="_tab">Full Preview</a>
</td>
</tr>
</table>
<!-- Use CDATA section so, this file can be processed by XSLT (e.g. to remove
comments and reduce size). -->
<script type="text/javascript">
function getURLParameter(name)
{
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == name)
return pair[1];
}
return null;
}
var content = document.getElementById("content");
var serviceName = getURLParameter("service");
var path = getURLParameter("path");
var expand = getURLParameter("expand");
function onPageLoad()
{
var height = 0;
if (!window.innerHeight) { //IE
if (!(document.documentElement.clientHeight == 0)) //strict mode
height = document.documentElement.clientHeight;
else //quirks mode
height = document.body.clientHeight;
} else //w3c
height = window.innerHeight;
content.style.height = height + "px";
var fullPreview = document.getElementById("fullPreview");
var fullLink = "index.php?path=" + getURLParameter("path");
fullPreview.setAttribute("href", fullLink);
}
function onHARLoad()
{
content.style.display = "none";
var url = serviceName + ".php?path=" + path + "&expand=" + (expand ? "true" : "false");
location.href = url;
}
</script>
<?php include("ga.php") ?>
</body>
</html>