1function retry(isDone, next) { 2 var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false; 3 var id = window.setInterval( 4 function() { 5 if (isDone()) { 6 window.clearInterval(id); 7 next(is_timeout); 8 } 9 if (current_trial++ > max_retry) { 10 window.clearInterval(id); 11 is_timeout = true; 12 next(is_timeout); 13 } 14 }, 15 10 16 ); 17} 18 19function isIE10OrLater(user_agent) { 20 var ua = user_agent.toLowerCase(); 21 if (ua.indexOf('msie') === 0 && ua.indexOf('trident') === 0) { 22 return false; 23 } 24 var match = /(?:msie|rv:)\s?([\d\.]+)/.exec(ua); 25 if (match && parseInt(match[1], 10) >= 10) { 26 return true; 27 } 28 return false; 29} 30 31function detectPrivateMode(callback) { 32 var is_private; 33 34 if (window.webkitRequestFileSystem) { 35 window.webkitRequestFileSystem( 36 window.TEMPORARY, 1, 37 function() { 38 is_private = false; 39 }, 40 function(e) { 41 console.log(e); 42 is_private = true; 43 } 44 ); 45 } else if (window.indexedDB && /Firefox/.test(window.navigator.userAgent)) { 46 var db; 47 try { 48 db = window.indexedDB.open('test'); 49 } catch(e) { 50 is_private = true; 51 } 52 53 if (typeof is_private === 'undefined') { 54 retry( 55 function isDone() { 56 return db.readyState === 'done' ? true : false; 57 }, 58 function next(is_timeout) { 59 if (!is_timeout) { 60 is_private = db.result ? false : true; 61 } 62 } 63 ); 64 } 65 } else if (isIE10OrLater(window.navigator.userAgent)) { 66 is_private = false; 67 try { 68 if (!window.indexedDB) { 69 is_private = true; 70 } 71 } catch (e) { 72 is_private = true; 73 } 74 } else if (window.localStorage && /Safari/.test(window.navigator.userAgent)) { 75 try { 76 window.localStorage.setItem('test', 1); 77 } catch(e) { 78 is_private = true; 79 } 80 81 if (typeof is_private === 'undefined') { 82 is_private = false; 83 window.localStorage.removeItem('test'); 84 } 85 } 86 87 retry( 88 function isDone() { 89 return typeof is_private !== 'undefined' ? true : false; 90 }, 91 function next(is_timeout) { 92 callback(is_private); 93 } 94 ); 95}
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.