-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdebug.html
executable file
·213 lines (195 loc) · 7.07 KB
/
debug.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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>Perfidies Debugging for Browsers and Plugins</title>
<script src="lib/jquery-1.3.2.min.js"></script>
<script src="lib/browserdetect.js"></script>
<script src="lib/plugindetect.js"></script>
<script src="lib/jquery.jsonp-1.1.0.js"></script>
<script src="perfidies.js"></script>
<script src="messages.js"></script>
<script src="modern_browser.js"></script>
<script src="exploder.js"></script>
<script src="plugincheck_ui.js"></script>
<script src="lib/jquery-1.3.2.min.js"></script>
<script src="tools/json2.js"></script>
<script>
$(document).ready(function(){
var browserInfo = Pfs.UI.browserInfo();
for (var key in browserInfo) {
$('#' + key).text(browserInfo[key]);
}
var ppkBrowserInfo = BrowserDetect.detect();
for (var key in ppkBrowserInfo) {
$('#ppk-' + key).text(ppkBrowserInfo[key]);
}
$($.browser).each(function(i, o){
for (var key in o) {
if (o[key]) {
$('#jquery-browser').append("<dt>" + key + "</dt><dd>" + o[key] + "</dd>");
}
}
});
var findOrMakePluginInfo = function(plugin, pluginInfos) {
// There are the pluginInfos that perfidies prepares
// and then there are unknown plugins.
for (var i=0; i < pluginInfos.length; i++) {
if (plugin.name === pluginInfos[i].raw.name) {
return pluginInfos[i];
}
}
var mimes = [];
for (var i=0; i< plugin.length; i++) {
mimes.push(plugin[i].type);
}
return {
raw: plugin,
mimes: mimes
};
};
if (window.navigator && window.navigator.plugins) {
$('#heading, #meta, #mime').hide();
/* Pfs.UI.browserPlugins gives us a subset of the user's
the navigator.plugins object has many more, including duplicates.
Since this is a debugging view.... We'll show both */
var pluginsObject = window.iePlugins || window.navigator.plugins || {};
var pluginInfos = Pfs.UI.browserPlugins(pluginsObject);
var pluginNamesSeen = {};
for(var i=0; i<= pluginsObject.length; i++) {
if (!pluginsObject[i]) {
continue;
}
if (pluginNamesSeen[pluginsObject[i].name]) {
continue;
} else {
pluginNamesSeen[pluginsObject[i].name] = true;
}
var pluginInfo = findOrMakePluginInfo(pluginsObject[i], pluginInfos);
if (pluginInfo && pluginInfo.raw) {
$('#nav').append("<li><a href='#plugin" + i + "'>" + pluginInfo.raw.name + "</a></li>");
if ((i % 5) == 0) {
var headingRow = $('#heading').clone();
headingRow.show().attr('id', null);
$('table').append(headingRow);
}
var metaRow = $('#meta').clone().attr('id', 'plugin' + i);
var mimeTypeRow = $('#mime').clone().attr('id', 'pluginmime' + i);
//TODO semantics have changed.. do we really want to call browserPlugin?
var wrappedPlugin = Pfs.UI.browserPlugin(pluginInfo.raw, pluginInfo.raw.mimes);
var detectedVersion = Pfs.parseVersion(wrappedPlugin.detected_version);
$('.name', metaRow).html(pluginInfo.raw.name);
$('.versionchain', metaRow).html(JSON.stringify(detectedVersion));
$('.versionproperty', metaRow).html(pluginInfo.raw.version);
$('.nameversion', metaRow).html(wrappedPlugin.detected_version);
$('.filename', metaRow).html(pluginInfo.raw.filename);
var mimeRow = "Batches:<ul><li>" + pluginInfo.mimes.join('</li><li>') + "</li></ul>";
$('.mimes', mimeTypeRow).html(mimeRow);
var testParams = 'plugins=' + escape(wrappedPlugin.detected_version) + '&mimes=' + escape(pluginInfo.mimes.join(' '))
$('.test-link a', mimeTypeRow).attr('href', 'tester.html#' + testParams);
$('table').append(metaRow);
$('table').append(mimeTypeRow);
metaRow.show(); mimeTypeRow.show();
}
}
} else {
$('#main table').replaceWith('No navigator.plugins');
}
});//document.ready
</script>
<style>
.panel {
border: solid 1px #AAA;
float: left;
padding: 0 0.3em;
margin: 1em;
}
.name {
font-weight: bold;
}
table
{
border-color: #000;
border-width: 0 0 1px 1px;
border-style: solid;
border-spacing: 0px;
margin: 0em 2em;
}
th { background-color: #CCC; }
td, th
{
border-color: #000;
border-width: 1px 1px 0 0;
border-style: solid;
margin: 0;
padding: 4px;
}
</style>
</head>
<body>
<h1>Perfidies Debugging for Browsers and Plugins</h1>
<p>This debugging page exposes Perfidies' view of the world to aid in development and debugging new browsers and plugins</p>
<p>Creates JSON files from your plugins. Adds one extra field <code>description</code> which may have useful extra info.
<strong>Warning:</strong> Be sure to clean/inspect values before use. Example: aliases - literal - Should be edited down to a useful literal value.
</p>
<div id="main">
<div class="panel">
<h2>Plugin List</h2>
<ol id="nav">
</ol>
</div>
<div class="panel">
<h2>Browser Info</h2>
<dl>
<dt>appID</dt><dd id="appID">324j23lj432klj</dd>
<dt>appRelease</dt><dd id="appRelease"></dd>
<dt>appVersion</dt><dd id="appVersion"></dd>
<dt>chromeLocale</dt><dd id="chromeLocale"></dd>
<dt>clientOS</dt><dd id="clientOS"></dd>
</dl>
</div>
<div class="panel">
<h2>PPK's Browser Detect</h2>
<dl>
<dt>browser</dt><dd id="ppk-browser"></dd>
<dt>build</dt><dd id="ppk-build"></dd>
<dt>os</dt><dd id="ppk-os"></dd>
<dt>version</dt><dd id="ppk-version"></dd>
</dl>
</div>
<div class="panel">
<h2>jQuery browser</h2>
<dl id="jquery-browser">
</dl>
<dl>
<dt>browser</dt><dd id="ppk-browser"></dd>
<dt>build</dt><dd id="ppk-build"></dd>
<dt>os</dt><dd id="ppk-os"></dd>
<dt>version</dt><dd id="ppk-version"></dd>
</dl>
</div>
<div class="panel">
<h2>Plugins</h2>
<p>This is Perfidies concept of the plugins, before contancting plugindir.
<strong>versionproperty</strong> is a Fx 3.6 feature where vendors can populate
<code>navigator.plugins[0].version</code>.
<strong>bestVersionString</strong> is a combination of name, versionproperty, description, and mimes
which is used to create the Version Chain. </p>
<table>
<thead>
<tr id="heading">
<th></th> <th>Name</th>
<th>Version Chain</th> <th>versionproperty</th> <th>bestVersionString</th> <th>filename</th>
</tr><tr id="meta">
<th>Metadata</th> <td class="name"></td> <td class="versionchain"></td>
<td class="versionproperty"></td> <td class="nameversion"></td> <td class="filename"></td>
</tr><tr id="mime">
<th title="I hate mimes">Mime Types</th> <td colspan="4" class="mimes"></td>
<td class="test-link"><a href="#">Test</a></td>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</body>
</html>