wlzboy
4 天以前 06a17c236d4cb9b8da75fce43af938cb7ea510bf
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
<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
          <meta name="renderer" content="webkit">
        <title><%= htmlWebpackPlugin.options.title %></title>
    <link rel="shortcut icon" type="image/x-icon" href="<%= BASE_URL %>static/favicon.ico">
        <script>
            var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') || CSS.supports('top: constant(a)'))
            document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
            
            // 禁用跨域子框架自动聚焦
            document.addEventListener('DOMContentLoaded', function() {
                // 阻止iframe内的自动聚焦
                document.addEventListener('focusin', function(e) {
                    if (e.target.tagName === 'IFRAME' || e.target.closest('iframe')) {
                        e.preventDefault()
                        e.stopPropagation()
                    }
                }, true)
                
                // 阻止webview内的自动聚焦
                document.addEventListener('focusin', function(e) {
                    if (e.target.tagName === 'WEB-VIEW' || e.target.closest('web-view')) {
                        e.preventDefault()
                        e.stopPropagation()
                    }
                }, true)
            })
        </script>
        <link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
    </head>
    <body>
        <noscript>
            <strong>本站点必须要开启JavaScript才能运行.</strong>
        </noscript>
        <div id="app"></div>
</html>