PageSourceSearch

https://www.nbpu.edu.cn/_upload/tpl/00/be/190/template190/js/lib/isIE.js

js nbpu.edu.cn collected 2026-10-09 22:26:55 UTC 2,157 bytes, 50 lines download raw bytes

1function sToolBrowserVersion() {
2    var ua = navigator.userAgent;
3    var isIE = false;
4    var version = null;
5    var isOpera = ua.indexOf('Opera') > -1 || ua.indexOf('OPR/') > -1;
6
7    if (ua.indexOf('Trident/') > -1 && ua.indexOf('rv:') > -1) {
8        var rvMatch = /rv:(\d+\.\d+)/.exec(ua);
9        if (rvMatch) {
10            isIE = true;
11            version = parseFloat(rvMatch[1]);
12            return { isIE: isIE, version: version };
13        }
14    }
15
16    if (ua.indexOf('MSIE ') > -1 && !isOpera) {
17        var msieMatch = /MSIE\s(\d+\.\d+)/.exec(ua);
18        if (msieMatch) {
19            isIE = true;
20            version = parseFloat(msieMatch[1]);
21            return { isIE: isIE, version: version };
22        }
23    }
24
25    return { isIE: isIE, version: version };
26}
27const o = sToolBrowserVersion();
28
29if (o.isIE && o.version <= 11) {
30    const html = '<div id="browser-modal"> <div class="browser-modal-cover"> </div>' +
31        ' <div class="browser-content"> <div class="browser-text">' +
32        ' <h3 class="browser-text-title">请升级浏览器版本</h3>' +
33        ' <p class="browser-text-desc"> 你正在使用旧版本浏览器。请升级浏览器以获得更好的体验。 </p> ' +
34        '</div> ' +
35        '<div class="browser-list">' +
36        ' <div class="browser-item"> <a href="https://www.google.cn/intl/zh-CN/chrome/" target="_blank">' +
37        ' <div class="iconfont iconchrome"> </div> ' +
38        '<h4>Chrome</h4> </a> </div> ' +
39        '<div class="browser-item"> <a href="http://www.firefox.com.cn/" target="_blank">' +
40        ' <div class="iconfont iconfirefox"> </div> ' +
41        '<h4>Firefox</h4> </a> </div> ' +
42        '<div class="browser-item"> <a href="https://www.apple.com.cn/safari/" target="_blank"> ' +
43        '<div class="iconfont iconsafari"> </div>' +
44        ' <h4>Safari</h4> </a> </div>' +
45        ' <div class="browser-item"> <a href="https://www.microsoft.com/zh-cn/edge" target="_blank"> ' +
46        '<div class="iconfont iconEdge"> </div> ' +
47        '<h4>Edge</h4> </a> </div>' +
48        ' </div> </div></div>'
49    document.write(html)
50} 

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.