forked from h5bp/html5please-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
192 lines (180 loc) · 9.36 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
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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>HTML5 Please Supported Browsers API</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="http://html5please.com/favicon.ico" />
<link href='http://fonts.googleapis.com/css?family=Alfa+Slab+One|Droid+Serif:700italic,400italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="site/css/style.css">
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<header>
<h1 class="logo">
<b>HTML5 Please API</b> <i>Identify Supported Browsers with Feature Detection</i>
</h1>
<div id="nav_container">
<nav id="toc">
<a href="#in-action">In Action</a>
<a href="#get-api">Get the widget</a>
<a href="#how-does-it-work">How does it work?</a>
<a href="#reference">Reference</a>
</nav>
</div>
</header>
<div id="about">
<p>If you've created a demo or site that requires Canvas or WebSQL DB, you've been in the awkward situation of telling some of your visitors that their browser doesn't support those features. But you can't just recommend they get a browser with those features; for example, "Get a WebRTC capable browser" is pretty much useless to everyone.
<p>The HTML5 Please API translates developer language (features) to user language (browsers). Call the API and you get back some HTML to show the user or a JSON object of the relevant data (with browser logos and all), so you can customize what you show to users.
</p>
<p> The API stays updated thanks to data from <a href="//caniuse.com">caniuse.com</a> so it remains accurate as browsers add support for more features. <a href="http://nimbupani.com/html5please-api.html">Read the backstory on this project</a>
</p>
</div>
<section id="in-action">
<h2>In action</h2>
<h3>on <a href="http://mothereffinganimatedgif.com">mothereffinganimatedgif.com</a></h3>
<figure>
<img src="site/with-support.png" alt="">
<figcaption>Page on a browser that support requested features</figcaption>
</figure>
<figure>
<img src="site/without-support.png" alt="">
<figcaption>Page on a browser that does not support requested features</figcaption>
</figure>
</section>
<section id="get-api">
<h2>Get the widget</h2>
<p>Are you using HTML5 features that are not available in all browsers and want to tell visitors with incompatible browers which browser to use to get the best experience of your site? </p>
<h3>Enter features you use</h3>
<form>
<label for="features">
<input id="features" type="text" required value="">
</label>
<div class="options">
<h3>How do you want to show this?</h3>
<div class="options-content">
<p>with browser
<b>
<input type="radio" name="skin" value="icon" id="options-logo">
<label for="options-logo">logos</label>
</b>
<b>
<input type="radio" name="skin" value="text" id="options-names">
<label for="options-names">names</label>
</b>
<b>
<input type="radio" name="skin" value="texticon" id="options-both" checked>
<label for="options-both">both logos & names</label>
</b>
</p>
<p>
<b>
<input type="checkbox" name="style" value="nocss" id="options-style">
<label for="options-style">without style</label>
</b>
</p>
</div>
</div>
</form>
<div id="api-result">
<div class="use">
<h3>Here is your widget</h3>
<h4>
<b>
<input type="radio" name="widgetformat" checked id="widget-modernizr" value="0">
<label for="widget-modernizr">with Modernizr <u>(recommended)</u></label>
</b>
<b>
<input type="radio" name="widgetformat" id="widget-js" value="1">
<label for="widget-js">just JS</label>
</b>
<b>
<input type="radio" name="widgetformat" id="widget-uri" value="2">
<label for="widget-uri">URI</label>
</b>
</h4>
<div id="widget">
</div>
<div id="widget-message" class="help"></div>
</div>
<div class="preview">
<h3>Sample Widget View</h3>
<div id="h5p-message"></div>
</div>
</div>
</section>
<section id="how-does-it-work">
<h2>How does it work?</h2>
<h4>Is the user's UA one of the browsers that offer these features?</h4>
<p>The User's browser User Agent information is matched against <a href="https://github.com/h5bp/html5please-api/blob/master/agents.json">this list of UAs</a> and then based on the information collated from <a href="https://github.com/h5bp/html5please-api/blob/master/data.json">caniuse's data feed</a>. If it supports the required features, we return a JSON object but no HTML, no message is displayed.</p>
<p>END</p>
<h4><b>Else</b> Is there a newer version of the user's browser supporting these features?</h4>
<p>If so, the message links to the newer version of the user's browser asking them to view the page in the newer version of their current browser.</p>
<p>END</p>
<h4><b>Else</b> Is there any other stable browser that support these features?</h4>
<p>If so, the widget links to all these stable browsers. If the user is viewing the page on desktop, it returns only desktop browsers. If user is viewing the page on mobile devices, it returns only mobile browsers that support these features.</p>
<p>In addition, for desktop browsers, if the user is on a non-windows machine, no IE recommendations will appear even if IE supports the required HTML5 features (as there is no supported version of IE on these platforms).</p>
<p>END</p>
</section>
<section id="reference">
<h2>Reference</h2>
<p><a href="https://github.com/h5bp/html5please-api/wiki/API-Reference">API Reference</a>: Explanation of all the options you can use to make this API call.</p>
<p><a href="https://github.com/h5bp/html5please-api/wiki/Data-Object-Reference">Data Object Reference</a>: Explanation of all the data returned by a call to this API.</p>
</section>
<section id="contribute">
<h2> Contribute </h2>
<p> This is a community project. You can <a href="https://github.com/h5bp/html5please-api">help by forking html5please-api</a> and making it better. Please also file a ticket to start a discussion. </p>
</section>
<footer>
<div class="builders">
<h3>Created By</h3>
<a href="http://twitter.com/jon_neal">
<img src="http://api.twitter.com/1/users/profile_image/jon_neal?size=normal" alt="Jon Neal">
<b>Jon</b> Neal
</a>
<a href="http://twitter.com/divya">
<img src="http://api.twitter.com/1/users/profile_image/divya?size=normal" alt="Divya Manian">
<b>Divya</b> Manian
</a>
</div>
<div class="builders">
<h3>With</h3>
<a href="http://twitter.com/paul_irish">
<img src="http://api.twitter.com/1/users/profile_image/paul_irish?size=normal" alt="Paul Irish">
<b>Paul</b> Irish
</a>
<a href="http://twitter.com/fyrd">
<img src="http://api.twitter.com/1/users/profile_image/fyrd?size=normal" alt="Alexis Deveria">
<b>Alexis</b> Deveria
</a>
<a href="http://twitter.com/aaronlayton">
<img src="http://api.twitter.com/1/users/profile_image/aaronlayton?size=normal" alt="Aaron Layton">
<b>Aaron</b> Layton
</a>
<a href="http://twitter.com/drublic">
<img src="http://api.twitter.com/1/users/profile_image/drublic?size=normal" alt="Hans Christian Reinl">
<b>Hans Chr.</b> Reinl
</a>
<a href="http://twitter.com/addyosmani">
<img src="http://api.twitter.com/1/users/profile_image/addyosmani?size=normal" alt="Addy Osmani">
<b>Addy</b> Osmani
</a>
</div>
<p> <a href="https://github.com/h5bp/html5please-api/contributors">& more</a> </p>
<p>This project was inspired by <a href="//get.webgl.org/">get.webgl.org</a> and was initiated over at <a href="https://github.com/paulirish/lazyweb-requests/issues/39">github:paulirish/lazyweb-requests#39</a>. <br>
Much thanks to <a href="//twitter.com/fyrd">Alexis Deveria</a> for the generous sharing of <a href="http://caniuse.com/">caniuse</a> data. </p>
</footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="site/js/jquery-1.7.1.min.js"><\/script>')</script>
<script src="site/js/jquery-ui-1.8.17.custom.min.js"></script>
<script src="site/js/script.js"></script>
<script>
var _gaq=[['_setAccount','UA-17904194-3'],['_trackPageview'],['_trackPageLoadTime']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
</body>
</html>