forked from 4ae9b8/browserhacks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
480 lines (387 loc) · 22.4 KB
/
test.php
File metadata and controls
480 lines (387 loc) · 22.4 KB
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
<!doctype html>
<html lang="en">
<head>
<title>Browserhacks - Tests</title>
<meta charset="utf-8">
<meta name="author" content="Hugo Giraudel, Tim Pietrusky">
<meta name="robots" content="index,follow">
<meta name="revisit-after" content="1 days">
<meta name="description" content="An extensive list of browserhacks from all over the interwebs.">
<meta property="og:title" content="browserhacks.com">
<meta property="og:description" content="An extensive list of browserhacks from all over the interwebs.">
<meta property="og:image" content="http://browserhacks.com/img/browserhacks_200.jpg">
<meta property="og:url" content="http://browserhacks.com">
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<link rel="stylesheet" href="css/browserhacks-ie.css">
<![endif]-->
<link rel="stylesheet" href="css/browserhacks.css">
<link rel="stylesheet" href="css/browserhacks-tests.css">
<link rel="shortcut icon" href="img/browserhacks.ico" type="image/x-icon">
</head>
<?php
// Load Browserhacks and run it
include_once('code/Browserhacks.php');
Browserhacks::run();
?>
<body id="browserhacks" data-max-width="1024" data-theme="browserhacks" data-auto-extend="true">
<ul class="nav-browser clearfix">
<li class="ch"><a href="#ch">Google Chrome</a></li>
<li class="fx"><a href="#fx">Mozilla Firefox</a></li>
<li class="ie"><a href="#ie">Internet Explorer</a></li>
<li class="op"><a href="#op">Opera</a></li>
<li class="sa"><a href="#sa">Safari</a></li>
</ul>
<article data-high="1">
<section data-cols="1" >
<h1><a href="/">Browserhacks</a></h1>
</section>
<p class="catch-phrase">
#test { <span class="catch-phrase__anim">
<span>_</span>
<span>-</span>
<span>£</span>
<span>¬</span>
<span>¦</span>
<span>!</span>
<span>$</span>
<span>&</span>
<span>*</span>
<span>(</span>
<span>)</span>
<span>=</span>
<span>%</span>
<span>+</span>
<span>@</span>
<span>,</span>
<span>.</span>
<span>/</span>
<span>`</span>
<span>[</span>
<span>]</span>
<span>#</span>
<span>~</span>
<span>?</span>
<span>:</span>
<span><</span>
<span>></span>
<span>|</span>
</span><span class="catch-phrase__space">it</span>: now; }
</p>
</article>
<article data-high="1" class="header-test">
<section data-cols="2">
<div>
<h2><span class="fontawesome-cog"></span>How does it work?</h2>
<p>When your browser matches a selector, the line turns <span class="example-span">green</span>. In most cases, it means your browser is likely to be targeted with a CSS hacks. You can't do much about it, sorry!</p>
<p><strong>However</strong>, when the point is to target <em>everything but X</em> (which in most cases is IE), being <span class="example-span">green</span> means your browser is standard compliant so it's a very good thing!</p>
</div>
<div>
<h2><span class="fontawesome-flag"></span>Want to report something weird?</h2>
<p>You can help us making this tool even more accurate by reporting things you think are weird or even bugs. Or even better, if you ever happen to find a new hacks, just <a href="https://github.com/4ae9b8/browserhacks/issues?state=open">open an issue on a bug tracker on GitHub</a>. Thanks! :)</p>
</div>
</section>
</article>
<article data-high="3" data-text="" class="ch" id="ch">
<section data-cols="1">
<h2 class="th">Chrome</h2>
</section>
<section data-cols="1">
<h3><span class="fontawesome-link"></span>Selector hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Safari (version?) and Chrome (not Canary) */
<span class="test59">::made-up-pseudo-element, .selector { background: lightgreen; }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-resize-small"></span>Media hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Chrome, Safari 3+ */
<span class="test63">@media screen and (-webkit-min-device-pixel-ratio:0) { .selector { background: lightgreen; } }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-fire"></span>JavaScript hacks</h3>
</section>
<section data-cols="1">
<pre class="language-javascript"><code>/* Chrome */
<span class="js-test-chrome-1">var isChrome = Boolean(window.chrome);</span></code></pre>
</section>
</article>
<article data-high="3" data-text="" class="fx" id="fx">
<section data-cols="1">
<h2 class="th">Firefox</h2>
</section>
<section data-cols="1">
<h3><span class="fontawesome-link"></span>Selector hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Firefox 1.5/2 */
<span class="test65">body:empty .selector { }</span></code></pre>
<pre class="language-css"><code>/* Firefox 2+ & IE 7 */
<span class="test54">.selector, x:-moz-any-link { background: lightgreen; }</span></code></pre>
<pre class="language-css"><code>/* Firefox 3+ (Windows?) & IE 7*/
<span class="test55">.selector, x:-moz-any-link, x:default { background: lightgreen; }</span></code></pre>
<pre class="language-css"><code>/* Firefox 3.5+ */
<span class="test56">body:not(:-moz-handler-blocked) .selector { background: lightgreen; }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-resize-small"></span>Media hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Firefox 3.5+, IE 9, Opera */
<span class="test57">@media screen and (min-resolution: +72dpi) { .selector { background: lightgreen; } }</span></code></pre>
<pre class="language-css"><code>/* Firefox 3.6+ */
<span class="test67">@media screen and (-moz-images-in-menus:0) { .selector { background: lightpink; } }</span></code></pre>
<pre class="language-css"><code>/* Firefox 4+ */
<span class="test68">@media screen and (min--moz-device-pixel-ratio:0) { .selector { background: lightpink; } }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-beaker"></span>Miscellaneous hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Firefox 3+ */
<span class="test58">@-moz-document url-prefix() { .selector { background: lightgreen; } }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-fire"></span>JavaScript hacks</h3>
</section>
<section data-cols="1">
<pre class="language-javascript"><code>/* Firefox */
<span class="js-test-ff-4">var isFF = !!navigator.userAgent.match(/firefox/i);</span></code></pre>
<pre class="language-javascript"><code>/* Firefox 2 - 13 */
<span class="js-test-ff-1">var isFF = Boolean(window.globalStorage);</span></code></pre>
<pre class="language-javascript"><code>/* Firefox 2/3 */
<span class="js-test-ff-3">var isFF = /a/[-1]=='a';</span></code></pre>
<pre class="language-javascript"><code>/* Firefox 3 */
<span class="js-test-ff-2">var isFF = (function x(){})[-5]=='x';</span></code></pre>
</section>
</article>
<article data-high="3" data-text="" class="ie" id="ie">
<section data-cols="1">
<h2 class="th">Internet Explorer</h2>
</section>
<section data-cols="1">
<h3><span class="fontawesome-link"></span>Selector hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* IE 6 and below */
<span class="test1">* html .selector { background: lightgreen; } </span>
<span class="test2">.fix.selector { background: lightgreen; } </span>/* .fix can be any unused class */</code></pre>
<pre class="language-css"><code>/* IE 7 and below */
<span class="test3">.selector, { background: lightgreen; }</span>
<span class="test4">//.selector { background: lightgreen; }</span> /* Doesn't seem to work */</code></pre>
<pre class="language-css"><code>/* IE 7 */
<span class="test5">*:first-child + html .selector { background: lightgreen; }</span>
<span class="test6">.selector, x:- { background: lightgreen; } </span>
<span class="test7">* + html .selector { background: lightgreen; }</span></code></pre>
<pre class="language-css"><code>/* Everything but IE 6 */
<span class="test8">html > body .selector { background: lightgreen; }</span></code></pre>
<pre class="language-css"><code>/* Everything but IE 6/7 */
<span class="test9">html > /**/ body .selector { background: lightgreen; }</span></code></pre>
<pre class="language-css"><code>/* Everything but IE 6/7/8 */
<span class="test10">:root * > .selector { background: lightgreen; }</span>
<span class="test11">body:last-child .selector { background: lightgreen; }</span>
<span class="test45">body:nth-of-type(1) .selector { background: lightgreen; }</span>
<span class="test46">body:first-of-type .selector { background: lightgreen; }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-paper-clip"></span>Property/value hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* IE 6 any combination of these characters: _ - £ ¬ ¦ */
<span class="test12" style="_background: lightgreen;">.selector { _background: lightgreen; }</span>
<span class="test13" style="-background: lightgreen;">.selector { -background: lightgreen; }</span>
<span class="test14" style="£background: lightgreen;">.selector { £background: lightgreen; }</span>
<span class="test15" style="¬background: lightgreen;">.selector { ¬background: lightgreen; }</span>
<span class="test16" style="¦background: lightgreen;">.selector { ¦background: lightgreen; }</span></code></pre>
<pre class="language-css"><code>/* IE 6/7 any combination of these characters: ! $ & * ( ) = % + @ , . / ` [ ] # ~ ? : < > | */
<span class="test17" style="!background: lightgreen;">.selector { !background: lightgreen; }</span>
<span class="test18" style="$background: lightgreen;">.selector { $background: lightgreen; }</span>
<span class="test19" style="&background: lightgreen;">.selector { &background: lightgreen; }</span>
<span class="test20" style="*background: lightgreen;">.selector { *background: lightgreen; }</span>
<span class="test21" style="(background: lightgreen;">.selector { (background: lightgreen; }</span>
<span class="test22" style=")background: lightgreen;">.selector { )background: lightgreen; }</span>
<span class="test23" style="=background: lightgreen;">.selector { =background: lightgreen; }</span>
<span class="test24" style="%background: lightgreen;">.selector { %background: lightgreen; }</span>
<span class="test25" style="+background: lightgreen;">.selector { +background: lightgreen; }</span>
<span class="test26" style="@background: lightgreen;">.selector { @background: lightgreen; }</span>
<span class="test27" style=",background: lightgreen;">.selector { ,background: lightgreen; }</span>
<span class="test28" style=".background: lightgreen;">.selector { .background: lightgreen; }</span>
<span class="test29" style="/background: lightgreen;">.selector { /background: lightgreen; }</span>
<span class="test30" style="`background: lightgreen;">.selector { `background: lightgreen; }</span>
<span class="test31" style="[background: lightgreen;">.selector { [background: lightgreen; }</span>
<span class="test32" style="]background: lightgreen;">.selector { ]background: lightgreen; }</span>
<span class="test33" style="#background: lightgreen;">.selector { #background: lightgreen; }</span>
<span class="test34" style="~background: lightgreen;">.selector { ~background: lightgreen; }</span>
<span class="test35" style="?background: lightgreen;">.selector { ?background: lightgreen; }</span>
<span class="test36" style=":background: lightgreen;">.selector { :background: lightgreen; }</span>
<span class="test37" style="<background: lightgreen;">.selector { <background: lightgreen; }</span>
<span class="test38" style=">background: lightgreen;">.selector { >background: lightgreen; }</span>
<span class="test39" style="|background: lightgreen;">.selector { |background: lightgreen; }</span></code></pre>
<pre class="language-css"><code>/* IE 6/7 - acts as an !important */
<span class="test40">.selector { background: lightgreen !ie; } </span>/* string after ! can be anything */</code></pre>
<pre class="language-css"><code>/* IE 7/8/9/10 */
<span class="test42">.selector { background/*\**/: lightgreen\9; }</span></code></pre>
<pre class="language-css"><code>/* IE 8/9 */
<span class="test43">.selector { background: lightgreen\0/; } </span>
/* must go at the END of all rules */</code></pre>
<pre class="language-css"><code>/* IE 9/10 */
<span class="test69">.selector:nth-of-type(1n) { background: lightgreen\9; }</span></code></pre>
<pre class="language-css"><code>/* IE 6/7/8/9/10 */
<span class="test41">.selector { background: lightgreen\9; }</span></code></pre>
<pre class="language-css"><code>/* Everything but IE 6 */
<span class="test44">.selector { background/**/: lightgreen; }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-resize-small"></span>Media hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* IE 6/7/8 */
<span class="test47">@media \0screen\,screen\9 { .selector { background: lightgreen; } }</span> </code></pre>
<pre class="language-css"><code>/* IE 8 */
<span class="test48">@media \0screen { .selector { background: lightgreen; } }</span></code></pre>
<pre class="language-css"><code>/* IE 9, Firefox 3.5+, Opera */
<span class="test57">@media screen and (min-resolution: +72dpi) { .selector { background: lightgreen; } }</span></code></pre>
<pre class="language-css"><code>/* IE 8/9/10 & Opera */
<span class="test49">@media screen\0 { .selector { background: lightgreen; } }</span></code></pre>
<pre class="language-css"><code>/* IE 9/10 */
<span class="test50">@media screen and (min-width:0\0) { .selector { background: lightgreen; } }</span></code></pre>
<pre class="language-css"><code>/* IE 10+ */
<span class="test51">@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
.selector { background: lightgreen; }
}</span></code></pre>
<pre class="language-css"><code>/* Everything but IE 6/7/8 - not a hack */
<span class="test52">@media screen and (min-width: 400px) { .selector { background: lightgreen; } }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-beaker"></span>Miscellaneous hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Everything but IE 6/7 - doesn't seem to work at all */
<span class="test53">@import "selector.css" all;</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-fire"></span>JavaScript hacks</h3>
</section>
<section data-cols="1">
<pre class="language-javascript"><code>/* IE <= 8 */
<span class="js-test-ie-1">var isIE = '\v'=='v';</span></code></pre>
<pre class="language-javascript"><code>/* IE 6 */
<span class="js-test-ie-2">(checkIE = document.createElement("b")).innerHTML = "<!--[if IE 6]><i></i><![endif]-->";
var isIE = checkIE.getElementsByTagName("i").length == 1;</span></code></pre>
<pre class="language-javascript"><code>/* IE 7 */
<span class="js-test-ie-3">(checkIE = document.createElement("b")).innerHTML = "<!--[if IE 7]><i></i><![endif]-->";
var isIE = checkIE.getElementsByTagName("i").length == 1;</span></code></pre>
<pre class="language-javascript"><code>/* IE 8 */
<span class="js-test-ie-4">(checkIE = document.createElement("b")).innerHTML = "<!--[if IE 8]><i></i><![endif]-->";
var isIE = checkIE.getElementsByTagName("i").length == 1;</span></code></pre>
<pre class="language-javascript"><code>/* IE 9 */
<span class="js-test-ie-5">(checkIE = document.createElement("b")).innerHTML = "<!--[if IE 9]><i></i><![endif]-->";
var isIE = checkIE.getElementsByTagName("i").length == 1;</span></code></pre>
<pre class="language-javascript"><code>/* IE 10 */
<span class="js-test-ie-6">var isIE = eval("/*@cc_on!@*/false") && document.documentMode === 10;</span></code></pre>
<pre class="language-javascript"><code>/* IE 10 */
<span class="js-test-ie-7">var isIE = document.body.style.msTouchAction != undefined;</span></code></pre>
</section>
</article>
<article data-high="3" data-text="" class="op" id="op">
<section data-cols="1">
<h2 class="th">Opera</h2>
</section>
<section data-cols="1">
<h3><span class="fontawesome-link"></span>Selector hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Opera 9.5+ */
<span class="test64">noindex:-o-prefocus, .selector { background: lightgreen; }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-resize-small"></span>Media hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Opera 7 */
<span class="test66">@media all and (min-width: 0px){ .selector { background: lightgreen; } }</span></code></pre>
<pre class="language-css"><code>/* Opera <= 12 */
<span class="test70">@media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { .selector { background: lightgreen; } }</span></code></pre>
<pre class="language-css"><code>/* Opera, IE 8/9/10 */
<span class="test49">@media screen\0 { .selector { background: lightgreen; } }</span></code></pre>
<pre class="language-css"><code>/* Opera, Firefox 3.5+, IE 9 */
<span class="test57">@media screen and (min-resolution: +72dpi) { .selector { background: lightgreen; } }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-fire"></span>JavaScript hacks</h3>
</section>
<section data-cols="1">
<pre class="language-javascript"><code>/* Opera <= 9.64 */
<span class="js-test-op-1">var isOpera = /^function \(/.test([].sort);</span></code></pre>
<pre class="language-javascript"><code>/* Opera <= 12.11 */
<span class="js-test-op-2">var isOpera = Boolean(window.opera);</span></code></pre>
</section>
</article>
<article data-high="3" data-text="" class="sa" id="sa">
<section data-cols="1">
<h2 class="th">Safari</h2>
</section>
<section data-cols="1">
<h3><span class="fontawesome-link"></span>Selector hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Safari 2/3 */
<span class="test60">html[xmlns*=""] body:last-child .selector { background: lightgreen; }</span>
<span class="test61">html[xmlns*=""]:root .selector { background: lightgreen; }</span></code></pre>
<pre class="language-css"><code>/* Safari 2/3.1, Opera 9.25 */
<span class="test62">*|html[xmlns*=""] .selector { background: lightgreen; }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-resize-small"></span>Media hacks</h3>
</section>
<section data-cols="1">
<pre class="language-css"><code>/* Safari 3+, Chrome */
<span class="test63">@media screen and (-webkit-min-device-pixel-ratio:0) { .selector { background: lightgreen; } }</span></code></pre>
</section>
<section data-cols="1">
<h3><span class="fontawesome-fire"></span>JavaScript hacks</h3>
</section>
<section data-cols="1">
<pre class="language-javascript"><code>/* Safari */
<span class="js-test-sa-1">var isSafari = /a/.__proto__=='//';</span></code></pre>
</section>
</article>
<article data-high="3" class="footer-test">
<section data-cols="1">
<div>
<footer>
<p>
<a href="#browserhacks" title="top" class="btn-top"><span class="fontawesome-circle-arrow-up"></span></a>
</p>
<p>
Handcrafted 2013 by <a href="https://twitter.com/HugoGiraudel" target="_blank" class="avatar avatar--hugo">Hugo Giraudel</a>
and <a href="https://twitter.com/TimPietrusky" target="_blank" class="avatar avatar--tim">Tim Pietrusky</a>
with contributions of the <a href="https://github.com/4ae9b8?tab=members" target="_blank">#4ae9b8</a> Team.</p>
</p>
</footer>
</div>
</section>
</article>
<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
<script src="js/modernizr.custom.38859.js"></script>
<script src="js/browserhacks-tests.js"></script>
<script type="text/javascript">
// Fallback CSS animation
if (!Modernizr.cssanimations){
// @TODO: [TimPietrusky] - Find a better place for this
var tips = ["_","-", "£", "¬", "¦", "!", "$", "&", "*", "(", ")", "=", "%", "+", "@", ",", ".", "/", "`", "[", "]", "#", "~", "?", ":", "<", ">", "|"];
setInterval(function() {
var i = Math.round((Math.random()) * tips.length);
if (i == tips.length) --i;
$(".catch-phrase__anim").html(tips[i]);
}, 400);
}
</script>
<?php if (Browserhacks::isLive()): ?>
<script type="text/javascript">var _gaq = _gaq || [];_gaq.push(['_setAccount', 'UA-38522111-1']);_gaq.push(['_setDomainName', 'browserhacks.com']);_gaq.push(['_trackPageview']);(function() {var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);})();</script>
<?php endif; ?>
</body>
</html>