1(function() { 2 var Lib = {}; 3 4// Device 5Lib.Device = { 6 isMobile: function() { 7 return /(?:iPhone|iPad|iPod|Android|Mobile)/.test(navigator.userAgent) === true; 8 } 9}; 10 11// Time 12Lib.Time = { 13 now: (new Date()).getTime(), 14 // beginStr, endStr: YYYYMMDD[HH[mm[ss]]] 15 // ex. if (Lib.Time.isInsidePeriod('20190809131200', '20190810000000')) {} 16 isInsidePeriod: function(beginStr, endStr) { 17 var beginNum = beginStr.replace(/[^\d]/g, ''); 18 if (beginNum.length < 8) return false; 19 var beginYear = parseInt(beginNum.substr(0, 4), 10); 20 var beginMonth = parseInt(beginNum.substr(4, 2), 10) - 1; 21 var beginDay = parseInt(beginNum.substr(6, 2), 10); 22 var beginHour = parseInt(beginNum.substr(8, 2), 10) || 0; 23 var beginMin = parseInt(beginNum.substr(10, 2), 10) || 0; 24 var beginSec = parseInt(beginNum.substr(12, 2), 10) || 0; 25 var beginDate = (new Date( 26 beginYear, 27 beginMonth, 28 beginDay, 29 beginHour, 30 beginMin, 31 beginSec 32 )).getTime(); 33 var endNum = endStr.replace(/[^\d]/g, ''); 34 if (endNum.length < 8) return false; 35 var endYear = parseInt(endNum.substr(0, 4), 10); 36 var endMonth = parseInt(endNum.substr(4, 2), 10) - 1; 37 var endDay = parseInt(endNum.substr(6, 2), 10); 38 var endHour = parseInt(endNum.substr(8, 2), 10) || 0; 39 var endMin = parseInt(endNum.substr(10, 2), 10) || 0; 40 var endSec = parseInt(endNum.substr(12, 2), 10) || 0; 41 var endDate = (new Date( 42 endYear, 43 endMonth, 44 endDay, 45 endHour, 46 endMin, 47 endSec 48 )).getTime(); 49 50 if (Lib.Time.now < beginDate || endDate < Lib.Time.now) return false; 51 return true; 52 } 53}; 54 55Lib.Fif = { 56 uuid: function() { 57 // https://github.com/GoogleChrome/chrome-platform-analytics/blob/master/src/internal/identifier.js 58 let chars = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.split(''); 59 for (let i = 0, len = chars.length; i < len; i++) { 60 switch (chars[i]) { 61 case 'x': 62 chars[i] = Math.floor(Math.random() * 16).toString(16); 63 break; 64 case 'y': 65 chars[i] = (Math.floor(Math.random() * 4) + 8).toString(16); 66 break; 67 } 68 } 69 return chars.join(''); 70 }, 71 write: function(targetClass, content, width, height) { 72 var proc = function() { 73 var elements = document.getElementsByClassName(targetClass); 74 if (elements.length < 1) return; 75 var target = elements[0]; 76 var iframe = document.createElement('iframe'); 77 iframe.width = width; 78 iframe.height = height; 79 iframe.frameBorder = "0"; 80 iframe.scrolling = "no"; 81 iframe.marginWidth = 0; 82 iframe.marginHeight = 0; 83 iframe.src = "about:self"; 84 target.appendChild(iframe); 85 var doc = iframe.contentWindow.document; 86 doc.open(); 87 var d = ""; 88 d += '<html><head></head>'; 89 d += '<body>'; 90 d += content; 91 d += '<script>inDapIF = true;</script>'; 92 d += '</body></html>'; 93 doc.write(d); 94 doc.close(); 95 } 96 97 Lib.attachEventListener(proc); 98 } 99}; 100 101Lib.Track = { 102 page: '', 103 generateDomTreeIndex: function(element, text) { 104 var label = text.replace(/"/g, ''); 105 var selector = 'a[data-track-label="' + label + '"]'; 106 var num = document.querySelectorAll(selector).length; 107 element.setAttribute('data-track-label', label); 108 element.setAttribute('data-track-index', num); 109 return num; 110 }, 111 isExternalUrl: function(url) { 112 var match = url.match(/^(?:https?:)\/\/([^\/]+)/); 113 if (match === null || match[1] === document.domain) return false; 114 return true; 115 }, 116 begin: function() { 117 var Lib = Lib || {}; 118 Lib.Track = Lib.Track || this; 119 120 if (Lib.Track.page === '') return; 121 122 var aElements = document.getElementsByTagName('a'); 123 Array.prototype.forEach.call(aElements, function(aElement) { 124 var eventHref = aElement.getAttribute('href') || ''; 125 var eventText = (aElement.innerText || aElement.innerHTML || '') 126 .replace(/\r|\n/g, ' ') 127 .replace(/\s+/g, ' ') 128 .trim() + ' (' + eventHref + ')'; 129 var eventIndex = Lib.Track.generateDomTreeIndex(aElement, eventText); 130 var eventLabrl = eventText + ' [' + eventIndex + '] '; 131 var eventAction = Lib.Track.page 132 + ( 133 Lib.Track.isExternalUrl(eventHref) 134 ? 'External' 135 : 'Internal' 136 ) 137 + 'LinkClick'; 138 var proc = function(e) { 139 ga('send', 'event', { 140 eventCategory: 'LinkClick', 141 eventAction: eventAction, 142 eventLabel: eventLabrl, 143 transport: 'beacon' 144 }); 145 } 146 147 if (aElement.addEventListener) { 148 aElement.addEventListener('click', proc, false); 149 } else if (window.attachEvent) { 150 aElement.attachEvent('onclick', proc); 151 } 152 }); 153 }, 154 beginAfterLoaded: function(page) { 155 Lib.Track.page = page; 156 var proc = Lib.Track.begin.bind(Lib.Track); 157 158 if (window.addEventListener) { 159 window.addEventListener('load', proc, false); 160 } else if (window.attachEvent) { 161 window.attachEvent('onload', proc); 162 } 163 } 164}; 165 166// Policy 167//Lib.Policy = function() { 168// var instance = null; 169// 170// Lib.Policy = function() { 171// if ((this instanceof Lib.Policy) == false) { 172// throw new Error('Please create instance of Lib.Policy.'); 173// } 174// 175// return instance; 176// }; 177// 178// Lib.Policy.prototype = this; 179// instance = new Lib.Policy(); 180// instance.constructor = Lib.Policy; 181// instance._isSafe = instance.isSafe(); 182// return instance; 183//}; 184// 185//Lib.Policy.prototype.isSafe = function() { 186// return true; 187//} 188 189// Ads 190Lib.Ads = function(isSafe) { 191 var isSafe = typeof isSafe === 'undefined' ? true : isSafe; 192 if ((this instanceof Lib.Ads) == false) { 193 throw new Error('Please create instance of Lib.Ads.'); 194 } 195 196 //var policy = new Lib.Policy(); 197 //this._isSafe = (policy._isSafe == true); 198 this._isSafe = true; 199 this._totalRates = 0; 200 this._items = []; 201}; 202 203Lib.Ads.prototype.isSafe = function() { 204 return this._isSafe; 205}; 206 207Lib.Ads.prototype.add = function(proc, rate, allowSafeOnly) { 208 var allowSafeOnly = typeof allowSafeOnly === 'undefined' ? false : allowSafeOnly; 209 if (this._isSafe == false && allowSafeOnly == true) return; 210 this._totalRates += rate; 211 this._items.push({ 212 proc: proc, 213 rate: rate 214 }); 215}; 216 217Lib.Ads.prototype.run = function() { 218 var proc = null; 219 var limit = 0; 220 var sample = Math.floor(Math.random() * this._totalRates); 221 for (var index in this._items) { 222 var item = this._items[index]; 223 limit += item.rate; 224 if (limit <= sample) continue; 225 proc = item.proc; 226 break; 227 } 228 if (proc == null) return; 229 return proc(); 230} 231 232// attachEventListener 233Lib.attachEventListener = function(proc) { 234 if (window.addEventListener) { 235 //window.addEventListener('load', proc, false); 236 document.addEventListener('DOMContentLoaded', proc, false); 237 } else if (window.attachEvent) { 238 window.attachEvent('onload', proc); 239 } else { 240 //window.onload = proc; 241 } 242}; 243 244 245//Lib.Policy.prototype.isSafe = isSafePage; 246 247 // if(is_policy_measures === true){ 248 // if(next_ad === 'i-mobile'){ 249 // document.write('\ 250 // <!-- usi32_pc_imp_article_01_right -->\ 251 // <div id="im-f49ae0b69fc244aa9767f7fa22e5c2bd">\ 252 // <script async src="//imp-adedge.i-mobile.co.jp/script/v1/spot.js?20181121"></script>\ 253 // <script>(window.adsbyimobile=window.adsbyimobile||[]).push({pid:44464,mid:526469,asid:1718635,type:"banner",dis
253play:"inline",elementid:"im-f49ae0b69fc244aa9767f7fa22e5c2bd"})</script>\ 254 // </div>\ 255 // '); 256 // } else { 257 // document.write('\ 258 // <!-- usi32_pc_imp_article_01_right -->\ 259 // <!-- ad tags Size: 300x250 ZoneId:1495789-->\ 260 // <div style="padding:15px 0;">\ 261 // <script type="text/javascript" src="https://js.adnico.jp/t/495/789/a1495789.js"></script>\ 262 // </div>\ 263 // '); 264 // } 265 // next_ad = switch_next_ad(next_ad); 266 // } else { 267 (function() { document.write('<div id="js-pc-article-01-right"><div id="div-gpt-ad-1654071789254-0"></div></div>'); 268document.write('\ 269 <script type="text/javascript">\ 270 googletag.cmd.push(function () {\ 271 googletag.pubads().disableInitialLoad();\ 272 googletag.enableServices();\ 273 var lines = [\ 274 {\ 275 code: "/21692532096/usi32_pc_article_01_right",\ 276 sizes: [[300, 250],[336, 280]],\ 277 divId: "div-gpt-ad-1654071789254-0",\ 278 isAps: true\ 279 }\ 280 ];\ 281 window.fluxtag.enableLazyLoad(lines);\ 282 });\ 283 </script>\ 284'); 285 })(); 286 /* 287 document.write('\ 288 <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>\ 289 <!-- pc_usi32_article_01_right -->\ 290 <ins class="adsbygoogle"\ 291 style="display:inline-block;width:336px;height:280px"\ 292 data-ad-client="ca-pub-1344381912509793"\ 293 data-ad-slot="8005491068"></ins>\ 294 <script>\ 295 (adsbygoogle = window.adsbygoogle || []).push({});\ 296 </script>\ 297 '); 298 */ 299// } 300})();
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.