1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10/** 11 * Observe how the user enters content into the comment form in order to determine whether it's a bot or not. 12 * 13 * Note that no actual input is being saved here, only counts and timings between events. 14 */ 15 16( function() { 17 // Passive event listeners are guaranteed to never call e.preventDefault(), 18 // but they're not supported in all browsers. Use this feature detection 19 // to determine whether they're available for use. 20 var supportsPassive = false; 21 22 try { 23 var opts = Object.defineProperty( {}, 'passive', { 24 get : function() { 25 supportsPassive = true; 26 } 27 } ); 28 29 window.addEventListener( 'testPassive', null, opts ); 30 window.removeEventListener( 'testPassive', null, opts ); 31 } catch ( e ) {} 32 33 function init() { 34 var input_begin = ''; 35 36 var keydowns = {}; 37 var lastKeyup = null; 38 var lastKeydown = null; 39 var keypresses = []; 40 41 var modifierKeys = []; 42 var correctionKeys = []; 43 44 var lastMouseup = null; 45 var lastMousedown = null; 46 var mouseclicks = []; 47 48 var mousemoveTimer = null; 49 var lastMousemoveX = null; 50 var lastMousemoveY = null; 51 var mousemoveStart = null; 52 var mousemoves = []; 53 54 var touchmoveCountTimer = null; 55 var touchmoveCount = 0; 56 57 var lastTouchEnd = null; 58 var lastTouchStart = null; 59 var touchEvents = []; 60 61 var scrollCountTimer = null; 62 var scrollCount = 0; 63 64 var correctionKeyCodes = [ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ]; 65 var modifierKeyCodes = [ 'Shift', 'CapsLock' ]; 66 67 var forms = document.querySelectorAll( 'form[method=post]' ); 68 69 for ( var i = 0; i < forms.length; i++ ) { 70 var form = forms[i]; 71 72 var formAction = form.getAttribute( 'action' ); 73 74 // Ignore forms that POST directly to other domains; these could be things like payment forms. 75 if ( formAction ) { 76 // Check that the form is posting to an external URL, not a path. 77 if ( formAction.indexOf( 'http://' ) == 0 || formAction.indexOf( 'https://' ) == 0 ) { 78 if ( formAction.indexOf( 'http://' + window.location.hostname + '/' ) != 0 && formAction.indexOf( 'https://' + window.location.hostname + '/' ) != 0 ) { 79 continue; 80 } 81 } 82 } 83 84 form.addEventListener( 'submit', function () { 85 var ak_bkp = prepare_timestamp_array_for_request( keypresses ); 86 var ak_bmc = prepare_timestamp_array_for_request( mouseclicks ); 87 var ak_bte = prepare_timestamp_array_for_request( touchEvents ); 88 var ak_bmm = prepare_timestamp_array_for_request( mousemoves ); 89 90 var input_fields = { 91 // When did the user begin entering any input? 92 'bib': input_begin, 93 94 // When was the form submitted? 95 'bfs': Date.now(), 96 97 // How many keypresses did they make? 98 'bkpc': keypresses.length, 99 100 // How quickly did they press a sample of keys, and how long between them? 101 'bkp': ak_bkp, 102 103 // How quickly did they click the mouse, and how long between clicks? 104 'bmc': ak_bmc, 105 106 // How many mouseclicks did they make? 107 'bmcc': mouseclicks.length, 108 109 // When did they press modifier keys (like Shift or Capslock)? 110 'bmk': modifierKeys.join( ';' ), 111 112 // When did they correct themselves? e.g., press Backspace, or use the arrow keys to move the cursor back 113 'bck': correctionKeys.join( ';' ), 114 115 // How many times did they move the mouse? 116 'bmmc': mousemoves.length, 117 118 // How many times did they move around using a touchscreen? 119 'btmc': touchmoveCount, 120 121 // How many times did they scroll?
122 'bsc': scrollCount, 123 124 // How quickly did they perform touch events, and how long between them? 125 'bte': ak_bte, 126 127 // How many touch events were there? 128 'btec' : touchEvents.length, 129 130 // How quickly did they move the mouse, and how long between moves? 131 'bmm' : ak_bmm 132 }; 133 134 var akismet_field_prefix = 'ak_'; 135 136 if ( this.getElementsByClassName ) { 137 // Check to see if we've used an alternate field name prefix. We store this as an attribute of the container around some of the Akismet fields. 138 var possible_akismet_containers = this.getElementsByClassName( 'akismet-fields-container' ); 139 140 for ( var containerIndex = 0; containerIndex < possible_akismet_containers.length; containerIndex++ ) { 141 var container = possible_akismet_containers.item( containerIndex ); 142 143 if ( container.getAttribute( 'data-prefix' ) ) { 144 akismet_field_prefix = container.getAttribute( 'data-prefix' ); 145 break; 146 } 147 } 148 } 149 150 for ( var field_name in input_fields ) { 151 var field = document.createElement( 'input' ); 152 field.setAttribute( 'type', 'hidden' ); 153 field.setAttribute( 'name', akismet_field_prefix + field_name ); 154 field.setAttribute( 'value', input_fields[ field_name ] ); 155 this.appendChild( field ); 156 } 157 }, supportsPassive ? { passive: true } : false ); 158 159 form.addEventListener( 'keydown', function ( e ) { 160 // If you hold a key down, some browsers send multiple keydown events in a row. 161 // Ignore any keydown events for a key that hasn't come back up yet. 162 if ( e.key in keydowns ) { 163 return; 164 } 165 166 var keydownTime = ( new Date() ).getTime(); 167 keydowns[ e.key ] = [ keydownTime ]; 168 169 if ( ! input_begin ) { 170 input_begin = keydownTime; 171 } 172 173 // In some situations, we don't want to record an interval since the last keypress -- for example, 174 // on the first keypress, or on a keypress after focus has changed to another element. Normally, 175 // we want to record the time between the last keyup and this keydown. But if they press a 176 // key while already pressing a key, we want to record the time between the two keydowns. 177 178 var lastKeyEvent = Math.max( lastKeydown, lastKeyup ); 179 180 if ( lastKeyEvent ) { 181 keydowns[ e.key ].push( keydownTime - lastKeyEvent ); 182 } 183 184 lastKeydown = keydownTime; 185 }, supportsPassive ? { passive: true } : false ); 186 187 form.addEventListener( 'keyup', function ( e ) { 188 if ( ! ( e.key in keydowns ) ) { 189 // This key was pressed before this script was loaded, or a mouseclick happened during the keypress, or... 190 return; 191 } 192 193 var keyupTime = ( new Date() ).getTime(); 194 195 if ( 'TEXTAREA' === e.target.nodeName || 'INPUT' === e.target.nodeName ) { 196 if ( -1 !== modifierKeyCodes.indexOf( e.key ) ) { 197 modifierKeys.push( keypresses.length - 1 ); 198 } else if ( -1 !== correctionKeyCodes.indexOf( e.key ) ) { 199 correctionKeys.push( keypresses.length - 1 ); 200 } else { 201 // ^ Don't record timings for keys like Shift or backspace, since they 202 // typically get held down for longer than regular typing. 203 204 var keydownTime = keydowns[ e.key ][0]; 205 206 var keypress = []; 207 208 // Keypress duration. 209 keypress.push( keyupTime - keydownTime ); 210 211 // Amount of time between this keypress and the previous keypress. 212 if ( keydowns[ e.key ].length > 1 ) { 213 keypress.push( keydowns[ e.key ][1] ); 214 } 215 216 keypresses.push( keypress ); 217 } 218 } 219 220 delete keydowns[ e.key ]; 221 222 lastKeyup = keyupTime; 223 }, supportsPassive ? { passive: true } : false ); 224 225 form.addEventListener( "focusin", function ( e ) { 226 lastKeydown = null; 227 lastKeyup = null; 228 keydowns = {}; 229 }, supportsPassive ? { passive: true } : false ); 230 231 form.addEventListener( "focusout", function ( e ) { 232 lastKeydown = null; 233 lastKeyup = null; 234 keydowns = {}; 235 }, supportsPassive ? { passive: true } : false ); 236 } 237 238 document.addEventListener( 'mousedown', function ( e ) { 239 lastMousedown = ( new Date() ).getTime(); 240 }, supportsPassive ? { passive: true } : false ); 241 242 document.addEventListener( 'mouseup', function ( e ) { 243 if ( ! lastMousedown ) { 244 // If the mousedown happened before this script was loaded, but the mouseup happened after... 245 return; 246 } 247 248 var now = ( new Date() ).getTime(); 249 250 var mouseclick = []; 251 mouseclick.push( now - lastMousedown ); 252 253 if ( lastMouseup ) { 254 mouseclick.push( lastMousedown - lastMouseup ); 255 } 256 257 mouseclicks.push( mouseclick ); 258 259 lastMouseup = now; 260 261 // If the mouse has been clicked, don't record this time as an interval between keypresses. 262 lastKeydown = null; 263 lastKeyup = null; 264 keydowns = {}; 265 }, supportsPassive ? { passive: true } : false ); 266 267 document.addEventListener( 'mousemove', function ( e ) { 268 if ( mousemoveTimer ) { 269 clearTimeout( mousemoveTimer ); 270 mousemoveTimer = null; 271 } 272 else { 273 mousemoveStart = ( new Date() ).getTime(); 274 lastMousemoveX = e.offsetX; 275 lastMousemoveY = e.offsetY; 276 } 277 278 mousemoveTimer = setTimeout( function ( theEvent, originalMousemoveStart ) { 279 var now = ( new Date() ).getTime() - 500; // To account for the timer delay. 280 281 var mousemove = []; 282 mousemove.push( now - originalMousemoveStart ); 283 mousemove.push( 284 Math.round( 285 Math.sqrt( 286 Math.pow( theEvent.offsetX - lastMousemoveX, 2 ) + 287 Math.pow( theEvent.offsetY - lastMousemoveY, 2 ) 288 ) 289 ) 290 ); 291 292 if ( mousemove[1] > 0 ) { 293 // If there was no measurable distance, then it wasn't really a move. 294 mousemoves.push( mousemove ); 295 } 296 297 mousemoveStart = null; 298 mousemoveTimer = null; 299 }, 500, e, mousemoveStart ); 300 }, supportsPassive ? { passive: true } : false ); 301 302 document.addEventListener( 'touchmove', function ( e ) { 303 if ( touchmoveCountTimer ) { 304 clearTimeout( touchmoveCountTimer ); 305 } 306 307 touchmoveCountTimer = setTimeout( function () { 308 touchmoveCount++; 309 }, 500 ); 310 }, supportsPassive ? { passive: true } : false ); 311 312 document.addEventListener( 'touchstart', function ( e ) { 313 lastTouchStart = ( new Date() ).getTime(); 314 }, supportsPassive ? { passive: true } : false ); 315 316 document.addEventListener( 'touchend', function ( e ) { 317 if ( ! lastTouchStart ) { 318 // If the touchstart happened before this script was loaded, but the touchend happened after... 319 return; 320 } 321 322 var now = ( new Date() ).getTime(); 323 324 var touchEvent = []; 325 touchEvent.push( now - lastTouchStart ); 326 327 if ( lastTouchEnd ) { 328 touchEvent.push( lastTouchStart - lastTouchEnd ); 329 } 330 331 touchEvents.push( touchEvent ); 332 333 lastTouchEnd = now; 334 335 // Don't record this time as an interval between keypresses. 336 lastKeydown = null; 337 lastKeyup = null; 338 keydowns = {}; 339 }, supportsPassive ? { passive: true } : false ); 340 341 document.addEventListener( 'scroll', function ( e ) {
342 if ( scrollCountTimer ) { 343 clearTimeout( scrollCountTimer ); 344 } 345 346 scrollCountTimer = setTimeout( function () { 347 scrollCount++; 348 }, 500 ); 349 }, supportsPassive ? { passive: true } : false ); 350 } 351 352 /** 353 * For the timestamp data that is collected, don't send more than `limit` data points in the request. 354 * Choose a random slice and send those. 355 */ 356 function prepare_timestamp_array_for_request( a, limit ) { 357 if ( ! limit ) { 358 limit = 100; 359 } 360 361 var rv = ''; 362 363 if ( a.length > 0 ) { 364 var random_starting_point = Math.max( 0, Math.floor( Math.random() * a.length - limit ) ); 365 366 for ( var i = 0; i < limit && i < a.length; i++ ) { 367 rv += a[ random_starting_point + i ][0]; 368 369 if ( a[ random_starting_point + i ].length >= 2 ) { 370 rv += "," + a[ random_starting_point + i ][1]; 371 } 372 373 rv += ";"; 374 } 375 } 376 377 return rv; 378 } 379 380 if ( document.readyState !== 'loading' ) { 381 init(); 382 } else { 383 document.addEventListener( 'DOMContentLoaded', init ); 384 } 385})(); 386}
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.