forked from InclineDigital/user-agent.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
118 lines (115 loc) · 5.42 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>What's My User Agent?</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootswatch/3.1.1/cerulean/bootstrap.min.css"/>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css"/>
<style>
body { padding-top: 50px; } /* for the navbar */
.jumbotron h1 {font-size: 32px; line-height: 40px;}
.banner-add { text-align: center; }
li {margin-bottom: 0.5em;}
</style>
<meta name="keywords" value="useragent,user-agent,user agent,explination,breakdown,details,parts,information,browser,spider,robots" />
</head>
<body>
<div class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<a href="/" class="navbar-brand">What's My User Agent?</a>
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div class="navbar-collapse collapse" id="navbar-main">
<ul class="nav navbar-nav">
<li>
<a href="http://nfriedly.com/" title="Javascript and Node.js expert">by Nathan Friedly</a>
</li>
<li>
<a href="https://github.com/nfriedly/whatsmyua.com"><i class="fa fa-github"></i> Source</a>
</li>
</div>
</div>
</div>
<header class="jumbotron">
<div class="container">
<h1><a href="#" id="ua-link"></a></h1>
<script>
function getUa() {
return location.hash.replace('#', '') || navigator.userAgent;
}
function updateLink(ua) {
var uaLink = document.getElementById('ua-link')
uaLink.href = '#' + ua;
uaLink.innerText = uaLink.textContent = ua;
}
updateLink(getUa());
</script>
</div>
</header>
<main>
<div class="container">
<div class="banner-add">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-9477050254721722"
data-ad-slot="0871459249"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
<div class="row">
<div class="col-sm-8">
<pre id="breakdown"></pre>
</div>
<div class="col-sm-4">
<h2>What is a "User Agent"?</h2>
<p>A User Agent is a short string that web browsers and other applications send to identify themselves to web servers. </p>
<p>Unfortunately, most browsers falsify part of their User-Agent header in an attempt to be compatible with more web servers.</p>
<h2>Tips</h2>
<ul>
<li>Click on your user-agent string (at the top) to get a link that you can share with other people.</li>
<li>Visit <code>whatsmyua.com/#[any-user-agent-string]</code>, the site will give you a breakdown for that string.</li>
<li>If something is missing or wrong, or you have any other ideas for improving the site, please <a href="https://github.com/nfriedly/whatsmyua.com">send an issue or pull request on Github <i class="fa fa-github"></i></a>.</li>
</ul>
</div>
</div>
<!--
<h2>Where's the cool breakdown table?</h2>
<p>It broke. Or, really, the app got moved to a new server, but it was several years old and depended that other stuff that was several years old, and I can't seem to get the right combination of outdated software installed to get the app running again and I don't have the time to update/rewrite everything right now. So, this is all you get. Take it or leave it.</p>
-->
</div>
</main>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script src="http://wzrd.in/standalone/ua-parser-js"></script>
<script>
function updateBreakdown(ua) {
var UAParser = window.uaParserJs;
var parser = new UAParser(ua);
$('#breakdown').text(JSON.stringify(parser.getResult(), undefined, 2));
}
updateBreakdown(getUa());
window.onhashchange = function() {
var ua = getUa();
updateLink(ua);
updateBreakdown(ua);
}
</script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-1735765-10");
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>