| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <!-- <link rel="icon" type="image/svg+xml" href="/vite.svg" />-->
- <link rel="stylesheet" href="src/assets/iconfont/iconfont.css" />
- <meta
- name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"
- />
- <title>h5</title>
- </head>
- <body>
- <div id="app"></div>
- <script type="module">
- if (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'sit') {
- // 异步加载 eruda
- const script = document.createElement('script');
- script.src = 'https://cdn.bootcdn.net/ajax/libs/eruda/2.3.3/eruda.min.js';
- script.onload = () => {
- eruda.init();
- };
- document.head.appendChild(script);
- }
- </script>
- <script type="module" src="/src/main.ts"></script>
- <script>
- function getBrowserInfo() {
- const userAgent = navigator.userAgent
- let browserName = 'Unknown'
- let browserVersion = 'Unknown'
- // 检查浏览器类型及版本
- if (userAgent.includes('Chrome')) {
- browserName = 'Chrome';
- // 提取 Chrome 版本
- const match = userAgent.match(/Chrome\/([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- } else if (userAgent.includes("Firefox")) {
- browserName = "Firefox";
- // 提取 Firefox 版本
- const match = userAgent.match(/Firefox\/([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- } else if (userAgent.includes("MSIE") || userAgent.includes("Trident")) {
- browserName = "Internet Explorer";
- // 提取 IE 版本
- const match = userAgent.match(/(?:MSIE |rv:)([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- } else if (userAgent.includes("Edge")) {
- browserName = "Edge";
- // 提取 Edge 版本
- const match = userAgent.match(/Edge\/([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- } else if (userAgent.includes("Safari")) {
- browserName = "Safari";
- // 提取 Safari 版本
- const match = userAgent.match(/Version\/([0-9]+)/);
- if (match) {
- browserVersion = match[1];
- }
- }
- return {
- browserName,
- browserVersion,
- };
- }
- // const browserInfo = getBrowserInfo();
- // console.log(`Browser: ${browserInfo.browserName}, Version: ${browserInfo.browserVersion}`);
- </script>
- </body>
- </html>
|