Add UA detection
This commit is contained in:
parent
12980b1669
commit
2d7bda3aa2
8 changed files with 167 additions and 30 deletions
61
browser.html
Normal file
61
browser.html
Normal file
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<meta http-equiv="Content-Language" content="th">
|
||||
<meta http-equiv="content-Type" content="text/html; charset=UTF-8">
|
||||
<title>ข้อมูลเบราว์เซอร์</title>
|
||||
<link rel="icon" type="image/png" href="icons/ttt-org.png">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="topbar">
|
||||
<a href="index.html" class="backbutton">
|
||||
<img src="icons/left.svg">
|
||||
</a>
|
||||
<div style="display: flex; align-items:start; justify-content: center; margin-top: -0.3cm;">
|
||||
<h4>ข้อมูลเบราว์เซอร์</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid-container">
|
||||
|
||||
<div class="middle">
|
||||
|
||||
<div class="list" style="margin-top: 1.5cm;">
|
||||
<a class="listinfo">
|
||||
<div style="display: flex; margin-left: 0.5cm; align-items: center; justify-content: left;">
|
||||
<p>เบราว์เซอร์</p>
|
||||
</div>
|
||||
<div style="display: flex; margin-right: 0.5cm; align-items: center; justify-content: right;">
|
||||
<p id="browser-display"></p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="separator"></div>
|
||||
|
||||
<a class="listinfo">
|
||||
<div style="display: flex; margin-left: 0.5cm; align-items: center; justify-content: left;">
|
||||
<p>ระบบปฏิบัติการ</p>
|
||||
</div>
|
||||
<div style="display: flex; margin-right: 0.5cm; align-items: center; justify-content: right;">
|
||||
<p id="os-display"></p>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
<script>
|
||||
const agent = navigator.userAgent;
|
||||
|
||||
const browserName = agent.split(" ")[agent.split(" ").length-1]
|
||||
document.getElementById("browser-display").innerHTML = browserName;
|
||||
|
||||
const OS = agent.split("(")[1].split(")")[0]
|
||||
document.getElementById("os-display").innerHTML = OS;
|
||||
|
||||
|
||||
</script>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue