云
5 小时以前 fb4db4ae9b6a7f113ba049f6789e6916c0dcc276
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
<!doctype html>
<html lang="zh">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <title>工业终端浏览器检测</title>
  <style>
    body{margin:0;padding:20px;font:16px/1.6 sans-serif;color:#0f172a;background:#f8fafc}
    main{max-width:480px;margin:auto}h1{font-size:22px}p{word-break:break-word}
    table{width:100%;border-collapse:collapse;background:white}td{padding:10px;border-bottom:1px solid #cbd5e1}
    .fail{color:#b91c1c}.pass{color:#166534}button,a{display:block;min-height:48px;font-size:16px;margin-top:16px}
    #agent{padding:12px;background:white;word-break:break-all}
  </style>
</head>
<body><main>
  <h1>工业终端浏览器检测</h1>
  <p>此页面不依赖平台框架。请将浏览器信息及“不支持”的检测项提供给管理员。</p>
  <p id="agent"></p>
  <table aria-label="浏览器能力"><tbody id="checks"></tbody></table>
  <p>全部通过仅代表基础能力可用,仍需根据平台启动信息检查依赖和网络。摄像头权限与硬件扫码是不同功能。</p>
  <button id="reload" type="button">重新检测</button><a href="./">返回平台</a>
  <noscript>浏览器禁用了 JavaScript,请先在浏览器设置中启用。</noscript>
</main><script>
(function () {
  document.getElementById('agent').textContent = navigator.userAgent;
  function syntax(code) { try { new Function(code); return true; } catch (error) { return false; } }
  function check(name, supported) {
    var row = document.createElement('tr');
    var title = document.createElement('td');
    var value = document.createElement('td');
    title.textContent = name; value.textContent = supported ? '支持' : '不支持';
    value.className = supported ? 'pass' : 'fail';
    row.appendChild(title); row.appendChild(value); document.getElementById('checks').appendChild(row);
  }
  check('模块脚本', 'noModule' in document.createElement('script'));
  check('动态模块导入', syntax('return import("./check.js")'));
  check('可选链 / 空值合并', syntax('var a = {}; return a?.b ?? 0'));
  check('异步函数', syntax('return async function () {}'));
  check('Proxy', typeof Proxy === 'function');
  check('Promise', typeof Promise === 'function');
  check('ResizeObserver', typeof ResizeObserver === 'function');
  check('dialog 弹层', typeof document.createElement('dialog').showModal === 'function');
  check('本地存储', (function () { try { var key = 'mom-browser-check-' + new Date().getTime(); localStorage.setItem(key, '1'); localStorage.removeItem(key); return true; } catch (error) { return false; } }()));
  check('安全环境(摄像头需要)', window.isSecureContext === true);
  document.getElementById('reload').onclick = function () { window.location.reload(); };
}());
</script></body></html>