Skip to content

Commit

Permalink
adding detection for MS Edge browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian Yaman committed Jan 19, 2018
1 parent 25ca107 commit c2156b4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions index.html
Expand Up @@ -71,6 +71,7 @@ <h2>Input tests <small>Note that you don't need to submit any form for data trac
<div id="height"></div>
<div id="chrome_detect"></div>
<div id="firefox_detect"></div>
<div id="edge_detect"></div>

<div id="font_detection1">test</div>

Expand Down
1 change: 1 addition & 0 deletions results.php
Expand Up @@ -39,6 +39,7 @@
<li></li>
<li>Browser Chrome: <b><?php print $_SESSION['browser_chrome']?></b></li>
<li>Browser Firefox: <b><?php print $_SESSION['browser_firefox']?></b></li>
<li>Browser Edge: <b><?php print $_SESSION['browser_edge']?></b></li>
<li>Orientation: <b><?php print $_SESSION['orientation']?></b></li>
<li>Resolution: <b><?php print $_SESSION['width']?>x<?php print $_SESSION['height']?></b> (only often used widths are supported, your screen resolution is greater than or equal to shown resolution.)</li>
</ul>
Expand Down
8 changes: 7 additions & 1 deletion screen.css
Expand Up @@ -86,7 +86,7 @@
}

/* Taken from http://browserhacks.com/ */
@supports (-webkit-appearance:none) {
@supports (-webkit-appearance:none) and (not (-ms-ime-align:auto)){
#chrome_detect::after {
content: url("track.php?action=browser_chrome");
}
Expand All @@ -98,6 +98,12 @@
}
}

/* Taken from https://browserstrangeness.github.io/css_hacks.html */
@supports (-ms-ime-align:auto) {
#edge_detect::after {
content: url("track.php?action=browser_edge")
}
}

/** Font detection **/
@font-face {
Expand Down
4 changes: 3 additions & 1 deletion track.php
Expand Up @@ -48,6 +48,9 @@
case "browser_firefox":
$_SESSION["browser_firefox"] = true;
break;
case "browser_edge":
$_SESSION["browser_edge"] = true;
break;
case "font1":
$_SESSION["font1"] = false;
break;
Expand All @@ -57,7 +60,6 @@
case "checkbox":
$_SESSION["checkbox"] = date(DATE_RFC822);
break;

case "reset":
session_unset();
print("Results were cleared!");
Expand Down

0 comments on commit c2156b4

Please sign in to comment.