发现精彩专栏 – 豆瓣时间

[]
豆瓣时间 (豆瓣时间) = 0) { document .documentElement .setAttribute(‘dark-mode', ‘1') } function extractVersionFrom(name) { var reg = new RegExp(name + “( |/)([0-9.]*)”, “i”); var info = navigator .userAgent .toLowerCase() .match(reg); var version = info ? info .pop() .split(‘.') .slice(0, 3) .join(‘.') : ”; return version; } function getOS() { var ua = navigator .userAgent .toLowerCase(); var os; if (/android/i.test(ua)) { os = ‘android'; } else if (/ipad|iphone|ipod/.test(ua)) { os = ‘ios'; } else { os = ‘web'; } return os } function vCompare(v1, v2) { if (!v1 || !v2) { return -1 } var v1Parts = v1.split(‘.'), v2Parts = v2.split(‘.'); while (v1Parts.length < v2Parts.length) { v1Parts.push('0'); } while (v2Parts.length < v1Parts.length) { v2Parts.push('0'); } for (var i = 0; i parseInt(v2Parts[i])) { return 1; } else if (parseInt(v1Parts[i]) = 0 && getOS() === 'ios' && vCompare(extractVersionFrom('iOS'), '13.4') >= 0 function replaceRexxarHttp(link) { link = IsCustomSchema ? link.replace(/^http/, ‘rexxar-http') : link if (IsCustomSchema) { var DEV_SCHEMA = window.localStorage && localStorage.DEV_SCHEMA if (DEV_SCHEMA && link.indexOf(‘img') m.douban = 0) { // iOS 5.25.0 才为local file加上跨域支持,https://github.com/douban/rexxar-ios/pull/98 // 所以需要等iOS 5.25.0 以下没有大量用户的时候,才可以给vendor文件加上crossorigin='anonymous' // 这里暂时先不给这类错误上报了 return } var label = { msg: msg, stack: error ? error.stack : [] }; var httpRequest = new XMLHttpRequest(); httpRequest.onreadystatechange = function () { if (httpRequest.readyState === XMLHttpRequest.DONE) { if (httpRequest.status === 200) { console.log(‘onerror reported success: ‘ + httpRequest.responseText) } } } httpRequest.open(‘POST', replaceRexxarHttp(‘https://frodo.douban.com/frodo_rexxar/api/jserror/'), true); httpRequest.setRequestHeader(‘Content-Type', ‘application/x-www-form-urlencoded'); var pack = { “message”: msg, “level”: “error”, “tags”: {}, “extra”: { url: url || location.href, line: line, col: col }, “stack”: error ? error.stack : [] } httpRequest.send(‘pack=' + encodeURIComponent(JSON.stringify(pack))); }]]>= 0) { return } console.error(‘onerror') console.error(arguments) var appNode = document.getElementById(‘app'); if (appNode.childNodes.length

You May Also Like