1var browserclientDetector = function (){ 2 var browserClient = ''; 3 4 // Opera 8.0+ 5 var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; 6 7 // Firefox 1.0+ 8 var isFirefox = typeof InstallTrigger !== 'undefined'; 9 10 // Safari 3.0+ "[object HTMLElementConstructor]" 11 var isSafari = /constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || (typeof safari !== 'undefined' && safari.pushNotification)); 12 13 // Internet Explorer 6-11 14 var isIE = /*@cc_on!@*/false || !!document.documentMode; 15 16 // Edge 20+ 17 var isEdge = !isIE && !!window.StyleMedia; 18 19 // Chrome 1 - 71 20 var isChrome = !!window.chrome && (!!window.chrome.webstore || !!window.chrome.runtime); 21 22 // Blink engine detection 23 var isBlink = (isChrome || isOpera) && !!window.CSS; 24 25 26 if(navigator.userAgent.match('CriOS')){ 27 browserClient = 'Chrome ios'; 28 return browserClient; 29 } 30 var isSafari = !!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/); 31 var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; 32 if (isSafari && iOS) { 33 browserClient = 'Safari ios'; 34 return browserClient; 35 } else if(isSafari) { 36 browserClient = 'Safari'; 37 return browserClient; 38 }else if(isFirefox){ 39 browserClient = 'Firefox'; 40 return browserClient; 41 }else if(isChrome){ 42 browserClient = 'Chrome'; 43 return browserClient; 44 }else if(isOpera){ 45 browserClient = 'Opera'; 46 return browserClient; 47 }else if(isIE ){ 48 browserClient = 'IE'; 49 return browserClient; 50 }else if(isEdge ){ 51 browserClient = 'Edge'; 52 return browserClient; 53 }else if( isBlink ){ 54 browserClient = 'Blink'; 55 return browserClient; 56 } 57 58 59} 60 61var pwaforwpGetOS = function() { 62 var userAgent = window.navigator.userAgent, 63 platform = window.navigator.platform, 64 macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'], 65 windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'], 66 iosPlatforms = ['iPhone', 'iPad', 'iPod'], 67 os = null; 68 69 if (macosPlatforms.indexOf(platform) !== -1) { 70 os = 'Mac OS'; 71 } else if (iosPlatforms.indexOf(platform) !== -1) { 72 os = 'iOS'; 73 } else if (windowsPlatforms.indexOf(platform) !== -1) { 74 os = 'Windows'; 75 } else if (/Android/.test(userAgent)) { 76 os = 'Android'; 77 } else if (!os && /Linux/.test(platform)) { 78 os = 'Linux'; 79 } 80 81 return os; 82} 83 84var addReportdata = function(params){ 85 var http = new XMLHttpRequest(); 86 var url = PWAforwpdafpData.ajax_url; 87 var params = params; 88 http.open('POST', url, true); 89 90 //Send the proper header information along with the request 91 http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); 92 93 http.onreadystatechange = function() {//Call a function when the state changes. 94 if(http.readyState == 4 && http.status == 200) { 95 console.log(http.responseText); 96 } 97 } 98 http.send(params); 99} 100 101function getCookie(cname) { 102 var name = cname + "="; 103 var decodedCookie = decodeURIComponent(document.cookie); 104 var ca = decodedCookie.split(';'); 105 for(var i = 0; i <ca.length; i++) { 106 var c = ca[i]; 107 while (c.charAt(0) == ' ') { 108 c = c.substring(1); 109 } 110 if (c.indexOf(name) == 0) { 111 return c.substring(name.length, c.length); 112 } 113 } 114 return ""; 115} 116 117 118 119//(function($){ 120 if (window.matchMedia('(display-mode: standalone)').matches || window.matchMedia('(display-mode: fullscreen)').matches ||window.matchMedia('(display-mode: minimal-ui)').matches) { 121 console.log('display-mode is standalone'); 122 var callCounting = true; 123 if(getCookie('pwaforwp_app_installed')=='hurray'){ 124 callCounting = false; 125 }else if( localStorage.getItem("pwaforwp_app_installed")=='hurray' ){ 126 callCounting = false; 127 } 128 if( callCounting ){ 129 var networkclient = browserclientDetector(); 130 var Osname = pwaforwpGetOS(); 131 var params = 'networkclient='+networkclient+'&os='+Osname+'&action=pwaforwp_dafp_action_call&csrf='+PWAforwpdafpData.nonce_csrf; 132 addReportdata(params); 133 localStorage.setItem("pwaforwp_app_installed", "hurray"); 134 document.cookie = "pwaforwp_app_installed=hurray;"; 135 } 136 } 137 if (window.navigator.standalone === true) { 138 console.log('IOS Sfari runs display-mode is standalone'); 139 var callCounting = true; 140 if(getCookie('pwaforwp_app_installed')=='hurray'){ 141 callCounting = false;
142 }else if( localStorage.getItem("pwaforwp_app_installed")=='hurray' ){ 143 callCounting = false; 144 } 145 if( callCounting ){ 146 var networkclient = browserclientDetector(); 147 var Osname = pwaforwpGetOS(); 148 var params = 'networkclient='+networkclient+'&os='+Osname+'&action=pwaforwp_dafp_action_call&csrf='+PWAforwpdafpData.nonce_csrf; 149 addReportdata(params); 150 localStorage.setItem("pwaforwp_app_installed", "hurray"); 151 document.cookie = "pwaforwp_app_installed=hurray;"; 152 } 153 } 154//}); 155
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.