PageSourceSearch

https://elojodeuk.com/_static/--/wp-content/js/mobile-useragent-in…/js/cmp-non-gdpr_m-1653088172j.js

js elojodeuk.com collected 2026-09-26 17:52:18 UTC 20,931 bytes, 653 lines download raw bytes

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( function ( g ) {
11
12  var t = {
13      PLATFORM_WINDOWS: 'windows',
14      PLATFORM_IPHONE: 'iphone',
15      PLATFORM_IPOD: 'ipod',
16      PLATFORM_IPAD: 'ipad',
17      PLATFORM_BLACKBERRY: 'blackberry',
18      PLATFORM_BLACKBERRY_10: 'blackberry_10',
19      PLATFORM_SYMBIAN: 'symbian_series60',
20      PLATFORM_SYMBIAN_S40: 'symbian_series40',
21      PLATFORM_J2ME_MIDP: 'j2me_midp',
22      PLATFORM_ANDROID: 'android',
23      PLATFORM_ANDROID_TABLET: 'android_tablet',
24      PLATFORM_FIREFOX_OS: 'firefoxOS',
25      PLATFORM_MOBILE_GENERIC: 'mobile_generic',
26
27      userAgent : false, // Shortcut to the browser User Agent String.
28      matchedPlatformName : false, // Matched platform name. False otherwise.
29      matchedUserAgentName : false, // Matched UA String. False otherwise.
30
31      init: function() {
32        try {
33          t.userAgent = g.navigator.userAgent.toLowerCase();
34          t.getPlatformName();
35          t.getMobileUserAgentName();
36        }	catch ( e ) {
37          console.error( e );
38        }
39      },
40
41      initForTest: function( userAgent ) {
42        t.matchedPlatformName = false;
43        t.matchedUserAgentName = false;
44        try {
45          t.userAgent = userAgent.toLowerCase();
46          t.getPlatformName();
47          t.getMobileUserAgentName();
48        }	catch ( e ) {
49          console.error( e );
50        }
51      },
52
53      /**
54       * This method detects the mobile User Agent name.
55       */
56      getMobileUserAgentName: function() {
57        if ( t.matchedUserAgentName !== false )
58          return t.matchedUserAgentName;
59
60        if ( t.userAgent === false )
61          return false;
62
63        if ( t.isChromeForIOS() )
64          t.matchedUserAgentName = 'chrome-for-ios';
65        else if ( t.isTwitterForIpad() )
66          t.matchedUserAgentName =  'twitter-for-ipad';
67        else if ( t.isTwitterForIphone() )
68          t.matchedUserAgentName =  'twitter-for-iphone';
69        else if ( t.isIPhoneOrIPod() )
70          t.matchedUserAgentName = 'iphone';
71        else if ( t.isIPad() )
72          t.matchedUserAgentName = 'ipad';
73        else if ( t.isAndroidTablet() )
74          t.matchedUserAgentName = 'android_tablet';
75        else if ( t.isAndroid() )
76          t.matchedUserAgentName = 'android';
77        else if ( t.isBlackberry10() )
78          t.matchedUserAgentName = 'blackberry_10';
79        else if ( has( 'blackberry' ) )
80          t.matchedUserAgentName = 'blackberry';
81        else if ( t.isBlackberryTablet() )
82          t.matchedUserAgentName = 'blackberry_tablet';
83        else if ( t.isWindowsPhone7() )
84          t.matchedUserAgentName = 'win7';
85        else if ( t.isWindowsPhone8() )
86          t.matchedUserAgentName = 'winphone8';
87        else if ( t.isOperaMini() )
88          t.matchedUserAgentName = 'opera-mini';
89        else if ( t.isOperaMobile() )
90          t.matchedUserAgentName = 'opera-mobi';
91        else if ( t.isKindleFire() )
92          t.matchedUserAgentName = 'kindle-fire';
93        else if ( t.isSymbianPlatform() )
94          t.matchedUserAgentName = 'series60';
95        else if ( t.isFirefoxMobile() )
96          t.matchedUserAgentName = 'firefox_mobile';
97        else if ( t.isFirefoxOS() )
98          t.matchedUserAgentName = 'firefoxOS';
99        else if ( t.isFacebookForIphone() )
100          t.matchedUserAgentName = 'facebook-for-iphone';
101        else if ( t.isFacebookForIpad() )
102          t.matchedUserAgentName = 'facebook-for-ipad';
103        else if ( t.isWordPressForIos() )
104          t.matchedUserAgentName = 'ios-app';
105        else if ( has( 'iphone' ) )
106          t.matchedUserAgentName = 'iphone-unknown';
107        else if ( has( 'ipad' ) )
108          t.matchedUserAgentName = 'ipad-unknown';
109
110        return t.matchedUserAgentName;
111      },
112
113      /**
114       * This method detects the mobile platform name.
115       */
116      getPlatformName : function() {
117        if ( t.matchedPlatformName !== false )
118          return t.matchedPlatformName;
119
120        if ( t.userAgent === false )
121          return false;
122
123        if ( has( 'windows ce' ) || has( 'windows phone' ) ) {
124          t.matchedPlatformName = t.PLATFORM_WINDOWS;
125        } else if ( has( 'ipad' ) ) {
126          t.matchedPlatformName = t.PLATFORM_IPAD;
127        } else if ( has( 'ipod' ) ) {
128          t.matchedPlatformName = t.PLATFORM_IPOD;
129        } else if ( has( 'iphone' ) ) {
130          t.matchedPlatformName = t.PLATFORM_IPHONE;
131        } else if ( has( 'android' ) ) {
132          if ( t.isAndroidTablet() )
133            t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET;
134          else
135            t.matchedPlatformName = t.PLATFORM_ANDROID;
136        } else if ( t.isKindleFire() ) {
137          t.matchedPlatformName = t.PLATFORM_ANDROID_TABLET;
138        } else if ( t.isBlackberry10() ) {
139          t.matchedPlatformName = t.PLATFORM_BLACKBERRY_10;
140        } else if ( has( 'blackberry' ) ) {
141          t.matchedPlatformName = t.PLATFORM_BLACKBERRY;
142        } else if ( t.isBlackberryTablet() ) {
143          t.matchedPlatformName = t.PLATFORM_BLACKBERRY;
144        } else if ( t.isSymbianPlatform() ) {
145          t.matchedPlatformName = t.PLATFORM_SYMBIAN;
146        } else if ( t.isSymbianS40Platform() ) {
147          t.matchedPlatformName = t.PLATFORM_SYMBIAN_S40;
148        } else if ( t.isJ2MEPlatform() ) {
149          t.matchedPlatformName = t.PLATFORM_J2ME_MIDP;
150        } else if ( t.isFirefoxOS() ) {
151          t.matchedPlatformName = t.PLATFORM_FIREFOX_OS;
152        } else if ( t.isFirefoxMobile() ) {
153          t.matchedPlatformName = t.PLATFORM_MOBILE_GENERIC;
154        }
155
156        return t.matchedPlatformName;
157      },
158
159
160      /**
161       * Detect the BlackBerry OS version.
162       *
163       * Note: This is for smartphones only. Does not work on BB tablets.
164       */
165      getBlackBerryOSVersion : check( function() {
166        if ( t.isBlackberry10() )
167          return '10';
168
169        if ( ! has( 'blackberry' ) )
170          return false;
171
172        var rv = -1; // Return value assumes failure.
173        var re;
174
175        if ( has( 'webkit' ) ) { // Detecting the BB OS version for devices running OS 6.0 or higher
176          re = /Version\/([\d\.]+)/i;
177        } else {
178          // BlackBerry devices <= 5.XX
179          re = /BlackBerry\w+\/([\d\.]+)/i;
180        }
181        if ( re.exec( t.userAgent ) != null )
182          rv =  RegExp.$1.toString();
183
184        return rv === -1 ? false : rv;
185      } ),
186
187      /**
188       * Detects if the current UA is iPhone Mobile Safari or another iPhone or iPod Touch Browser.
189       */
190      isIPhoneOrIPod : check( function() {
191        return has( 'safari' ) && ( has( 'iphone' ) || has( 'ipod' ) );
192      } ),
193
194      /**
195       * Detects if the current device is an iPad.
196       */
197      isIPad : check( function() {
198        return has( 'ipad' ) && has( 'safari' );
199      } ),
200
201
202      /**
203      *  Detects if the current UA is Chrome for iOS
204      */
205      isChromeForIOS : check( function() {
206        return t.isIPhoneOrIPod() && has( 'crios/' );
207      } ),
208
209      /**
210       * Detects if the current browser is the Native Android browser.
211       */
212      isAndroid : check( function() {
213        if ( has( 'android' ) ) {
214          return ! ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() );
215        }
216      } ),
217
218      /**
219       * Detects if the current browser is the Native Android Tablet browser.
220       */
221       isAndroidTablet : check( function() {
222        if ( has( 'android' ) && ! has( 'mobile' ) ) {
223          return ! ( t.isOperaMini() || t.isOperaMobile() || t.isFirefoxMobile() );
224        }
225      } ),
226
227
228      /**
229       * Detects if the current browser is Opera Mobile
230       */
231      isOperaMobile : check( function() {
232        return has( 'opera' ) && has( 'mobi' );
233      } ),
234
235      /**
236       * Detects if the current browser is Opera Mini
237       */
238      isOperaMini : check( function() {
239        return has( 'opera' ) && has( 'mini' );
240      } ),
241
242
243      /**
244       * isBlackberry10() can be used to check the User Agent for a BlackBerry 10 device.
245       */
246      isBlackberry10 : check( function() {
247        return has( 'bb10' ) && has( 'mobile' );
248      } ),
249
250      /**
251       * isBlackberryTablet() can be used to check the User Agent for a RIM blackberry tablet
252       */
253      isBlackberryTablet : check( function() {
254        return has( 'playbook' ) && has( 'rim tablet' );
255      } ),
256
257      /**
258       * Detects if the current browser is a Windows Phone 7 device.
259       */
260      isWindowsPhone7 : check( function () {
261        return has( 'windows phone os 7' );
262      } ),
263
264      /**
265       * Detects if the current browser is a Windows Phone 8 device.
266       */
267      isWindowsPhone8 : check( function () {
268        return has( 'windows phone 8' );
269      } ),
270
271      /**
272       * Detects if the device platform is J2ME.
273       */
274      isJ2MEPlatform : check( function () {
275        return has( 'j2me/midp' ) || ( has( 'midp' ) && has( 'cldc' ) );
276      } ),
277
278
279      /**
280       * Detects if the device platform is the Symbian Series 40.
281       */
282      isSymbianS40Platform : check( function() {
283        if ( has( 'series40' ) ) {
284          return has( 'nokia' ) || has( 'ovibrowser' ) || has( 'nokiabrowser' );
285        }
286      } ),
287
288
289      /**
290       * Detects if the device platform is the Symbian Series 60.
291       */
292      isSymbianPlatform : check( function() {
293        if ( has( 'webkit' ) ) {
294          // First, test for WebKit, then make sure it's either Symbian or S60.
295          return has( 'symbian' ) || has( 'series60' );
296        } else if ( has( 'symbianos' ) && has( 'series60' ) ) {
297          return true;
298        } else if ( has( 'nokia' ) && has( 'series60' ) ) {
299          return true;
300        } else if ( has( 'opera mini' ) ) {
301          return has( 'symbianos' ) || has( 'symbos' ) || has( 'series 60' );
302        }
303      } ),
304
305
306      /**
307       * Detects if the current browser is the Kindle Fire Native browser.
308       */
309      isKindleFire : check( function() {
310        return has( 'silk/' ) && has( 'silk-accelerated=' );
311      } ),
312
313      /**
314       * Detects if the current browser is Firefox Mobile (Fennec)
315       */
316      isFirefoxMobile : check( function() {
317        return has( 'fennec' );
318      } ),
319
320
321      /**
322       * Detects if the current browser is the native FirefoxOS browser
323       */
324      isFirefoxOS : check( function() {
325        return has( 'mozilla' ) && has( 'mobile' ) && has( 'gecko' ) && has( 'firefox' );
326      } ),
327
328
329      /**
330       * Detects if the current UA is Facebook for iPad
331       */
332      isFacebookForIpad : check( function() {
333        if ( ! has( 'ipad' ) )
334          return false;
335
336        return has( 'facebook' ) || has( 'fbforiphone' ) || has( 'fban/fbios;' );
337      } ),
338
339      /**
340       * Detects if the current UA is Facebook for iPhone
341       */
342      isFacebookForIphone : check( function() {
343        if ( ! has( 'iphone' ) )
344          return false;
345
346        return ( has( 'facebook' ) && ! has( 'ipad' ) ) ||
347          ( has( 'fbforiphone' ) && ! has( 'tablet' ) ) ||
348          ( has( 'fban/fbios;' ) && ! has( 'tablet' ) ); // FB app v5.0 or higher
349      } ),
350
351      /**
352       * Detects if the current UA is Twitter for iPhone
353       */
354      isTwitterForIphone : check( function() {
355        if ( has( 'ipad' ) )
356          return false;
357
358        return has( 'twitter for iphone' );
359      } ),
360
361      /**
362       * Detects if the current UA is Twitter for iPad
363       */
364      isTwitterForIpad : check( function() {
365        return has( 'twitter for ipad' ) || ( has( 'ipad' ) && has( 'twitter for iphone' ) );
366      } ),
367
368
369      /**
370       * Detects if the current UA is WordPress for iOS
371       */
372      isWordPressForIos : check( function() {
373        return has( 'wp-iphone' );
374      } )
375  };
376
377  function has( str ) {
378    return t.userAgent.indexOf( str ) != -1;
379  }
380
381  function check( fn ) {
382    return function() {
383      return t.userAgent === false ? false : fn() || false;
384    }
385  }
386
387  g.wpcom_mobile_user_agent_info = t;
388
389} )( typeof window !== 'undefined' ? window : this );
390;
391// listen for rlt authentication events and pass them to children of this document.
392( function() {
393	var currentToken;
394	var parentOrigin;
395	var iframeOrigins;
396	var initializationListeners = [];
397	var hasBeenInitialized = false;
398	var RLT_KEY = 'jetpack:wpcomRLT';
399
400	// IE11 compat version that doesn't require on `new URL( src )`
401	function getOriginFromUrl( url ) {
402		var parser = document.createElement('a');
403		parser.href = url;
404		return parser.origin;
405	}
406
407	// run on `load` for suitable iframes, this injects the current token if available
408	function rltIframeInjector( event ) {
409		if ( ! currentToken ) {
410			return;
411		}
412		rltInjectToken( currentToken, event.target.contentWindow, getOriginFromUrl( event.target.src ) );
413	}
414
415	// run on DOMContentLoaded or later
416	function rltMonitorIframes() {
417		// wait until suitable iframes are loaded before trying to inject the RLT
418		var iframes = document.querySelectorAll( "iframe" );
419		for( var i=0; i<iframes.length; i++ ) {
420			var iframe = iframes[i];
421			if ( rltShouldAuthorizeIframe( iframe ) ) {
422				iframe.addEventListener('load', rltIframeInjector);
423			}
424		}
425
426		// listen for newly-created iframes, since some are injected dynamically
427		var observer = new MutationObserver(function( mutationsList, observer ) {
428			for(var i=0; i<mutationsList.length; i++) {
429				var mutation = mutationsList[i];
430				if (mutation.type === 'childList') {
431					for(var j=0; j<mutation.addedNodes.length; j++) {
432						var node = mutation.addedNodes[j];
433						if (node instanceof HTMLElement && node.nodeName === 'IFRAME' && rltShouldAuthorizeIframe(node)) {
434							node.addEventListener('load', rltIframeInjector);
435						}
436					}
437				}
438			}
439		});
440
441		observer.observe(document.body, { subtree: true, childList: true });
442	}
443
444	// should we inject RLT into this iframe?
445	function rltShouldAuthorizeIframe( iframe ) {
446		if ( ! Array.isArray( iframeOrigins ) ) {
447			return;
448		}
449		return iframeOrigins.indexOf( getOriginFromUrl( iframe.src ) ) >= 0;
450	}
451
452	function rltInvalidateWindowToken( token, target, origin ) {
453		if ( target && typeof target.postMessage === 'function' ) {
454			try {
455				target.postMessage( JSON.stringify( {
456					type: 'rltMessage',
457					data: {
458						event: 'invalidate',
459						token: token,
460						sourceOrigin: window.location.origin,
461					},
462				} ), origin );
463			} catch ( err ) {
464				return;
465			}
466		}
467	}
468
469	/**
470	 * PUBLIC METHODS
471	 */
472	window.rltInvalidateToken = function( token, sourceOrigin ) {
473		// invalidate in current context
474		if ( token === currentToken ) {
475			currentToken = null;
476		}
477
478		// remove from localstorage, but only if in a top level window, not iframe
479		try {
480			if ( window.location === window.parent.location && window.localStorage ) {
481				if ( window.localStorage.getItem(RLT_KEY) === token ) {
482					window.localStorage.removeItem(RLT_KEY);
483				}
484			}
485		} catch( e ) {
486			console.info("localstorage access for invalidate denied - probably blocked third-party access", window.location.href);
487		}
488
489		// invalidate in iframes
490		var iframes = document.querySelectorAll("iframe");
491		for( var i=0; i<iframes.length; i++ ) {
492			var iframe = iframes[i];
493			var iframeOrigin = getOriginFromUrl( iframe.src );
494			if ( iframeOrigin !== sourceOrigin && rltShouldAuthorizeIframe( iframe ) ) {
495				rltInvalidateWindowToken( token, iframe.contentWindow, iframeOrigin );
496			}
497		}
498
499		// invalidate in parent
500		if ( parentOrigin && parentOrigin !== sourceOrigin && window.parent ) {
501			rltInvalidateWindowToken( token, window.parent, parentOrigin );
502		}
503	}
504
505	window.rltInjectToken = function( token, target, origin ) {
506		if ( target && typeof target.postMessage === 'function' ) {
507			try {
508				target.postMessage( JSON.stringify( {
509					type: 'loginMessage',
510					data: {
511						event: 'login',
512						success: true,
513						type: 'rlt',
514						token: token,
515						sourceOrigin: window.location.origin,
516					},
517				} ), origin );
518			} catch ( err ) {
519				return;
520			}
521		}
522	};
523
524	window.rltIsAuthenticated = function() {
525		return !! currentToken;
526	};
527
528	window.rltGetToken = function() {
529		return currentToken;
530	};
531
532	window.rltAddInitializationListener = function( listener ) {
533		// if RLT is already initialized, call the listener immediately
534		if ( hasBeenInitialized ) {
535			listener( currentToken );
536		} else {
537			initializationListeners.push( listener );
538		}
539	};
540
541	// store the token in localStorage
542	window.rltStoreToken = function( token ) {
543		currentToken = token;
544		try {
545			if ( window.location === window.parent.location && window.localStorage ) {
546				window.localStorage.setItem( RLT_KEY, token );
547			}
548		} catch( e ) {
549			console.info("localstorage access denied - probably blocked third-party access", window.location.href);
550		}
551	}
552
553	window.rltInitialize = function( config ) {
554		if ( ! config || typeof window.postMessage !== 'function' ) {
555			return;
556		}
557
558		currentToken  = config.token;
559		iframeOrigins = config.iframeOrigins;
560		parentOrigin  = config.parentOrigin; // needed?
561
562		// load token from localStorage if possible, but only in top level window
563		try {
564			if ( ! currentToken && window.location === window.parent.location && window.localStorage ) {
565				currentToken = window.localStorage.getItem(RLT_KEY);
566			}
567		} catch( e ) {
568			console.info("localstorage access denied - probably blocked third-party access", window.location.href);
569		}
570
571		// listen for RLT events from approved origins
572		window.addEventListener( 'message', function( e ) {
573			var message = e && e.data;
574			if ( typeof message === 'string' ) {
575				try {
576					message = JSON.parse( message );
577				} catch ( err ) {
578					return;
579				}
580			}
581
582			var type = message && message.type;
583			var data = message && message.data;
584
585			if ( type !== 'loginMessage' ) {
586				return;
587			}
588
589			if ( data && data.type === 'rlt' && data.token !== currentToken ) {
590
591				// put into localStorage if running in top-level window (not iframe)
592				rltStoreToken( data.token );
593
594				// send to allowlisted iframes
595				var iframes = document.querySelectorAll("iframe");
596				for( var i=0; i<iframes.length; i++ ) {
597					var iframe = iframes[i];
598					if ( rltShouldAuthorizeIframe( iframe ) ) {
599						rltInjectToken( currentToken, iframe.contentWindow, getOriginFromUrl( iframe.src ) );
600					}
601				}
602
603				// send to the parent, unless the event was sent _by_ the parent
604				if ( parentOrigin && parentOrigin !== data.sourceOrigin && window.parent ) {
605					rltInjectToken( currentToken, window.parent, parentOrigin );
606				}
607			}
608		} );
609
610		// listen for RLT events from approved origins
611		window.addEventListener( 'message', function( e ) {
612			var message = e && e.data;
613			if ( typeof message === 'string' ) {
614				try {
615					message = JSON.parse( message );
616				} catch ( err ) {
617					return;
618				}
619			}
620
621			var type = message && message.type;
622			var data = message && message.data;
623
624			if ( type !== 'rltMessage' ) {
625				return;
626			}
627
628			if ( data && data.event === 'invalidate' && data.token === currentToken ) {
629				rltInvalidateToken( data.token );
630			}
631		} );
632
633		if ( iframeOrigins ) {
634			if ( document.readyState !== 'loading' ) {
635				rltMonitorIframes();
636			} else {
637				window.addEventListener( 'DOMContentLoaded', rltMonitorIframes );
638			}
639		}
640
641		initializationListeners.forEach( function( listener ) {
642			listener( currentToken );
643		} );
644
645		initializationListeners = [];
646
647		hasBeenInitialized = true;
648	};
649} )();
650;
651window.__tcfapi=function(){let e=[].slice.call(arguments),t=e[0],n=e[2];"ping"===t?"function"==typeof n&&n({gdprApplies:!1,cmpLoaded:!1,cmpStatus:"stub",displayStatus:"disabled",apiVersion:"2"}):"getTCData"!==t&&"addEventListener"!==t||"function"==typeof n&&n({gdprApplies:!1,tcfPolicyVersion:2,cmpId:258,cmpVersion:1},!0)},window.addEventListener("message",(function(e){let t="string"==typeof e.data,n={};try{n=t?JSON.parse(e.data):e.data}catch(e){}let a=n.__tcfapiCall;a&&window.__tcfapi(a.command,a.version,(function(n,c){let s={__tcfapiReturn:{returnValue:n,success:c,callId:a.callId}};t&&(s=JSON.stringify(s)),e&&e.source&&e.source.postMessage&&e.source.postMessage(s,"*")}),a.parameter)}),!1),document.addEventListener("DOMContentLoaded",(function(){!function(){const e=document.createElement("iframe");e.style.cssText="display:none",e.name="__tcfapiLocator",document.body.appendChild(e)}()}));;
652
653}

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.