All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.bull.javamelody.resource.boomerang.min.js Maven / Gradle / Ivy

There is a newer version: 2.3.0
Show newest version
/*
 * Copyright (c) 2011, Yahoo! Inc.  All rights reserved.
 * Copyright (c) 2012, Log-Normal, Inc.  All rights reserved.
 * Copyright (c) 2014, SOASTA, Inc. All rights reserved.
 * Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms.
 */
function BOOMR_check_doc_domain(a){var b;if(!a){if(window.parent===window||!document.getElementById("boomr-if-as"))return!0;a=document.domain}if(-1===a.indexOf("."))return!1;try{return b=window.parent.document,void 0!==b}catch(c){document.domain=a}try{return b=window.parent.document,void 0!==b}catch(c){a=a.replace(/^[\w\-]+\./,"")}return BOOMR_check_doc_domain(a)}BOOMR_start=(new Date).getTime(),BOOMR_check_doc_domain(),function(a){function g(a,b){var c=f(a,{detail:b});c&&BOOMR.setImmediate(function(){d.dispatchEvent?d.dispatchEvent(c):d.fireEvent&&d.fireEvent("onpropertychange",c)})}var b,c,d,e,f;a.parent!==a&&document.getElementById("boomr-if-as")&&"script"===document.getElementById("boomr-if-as").nodeName.toLowerCase()&&(a=a.parent,e=document.getElementById("boomr-if-as").src),d=a.document,void 0===a.BOOMR&&(a.BOOMR={}),BOOMR=a.BOOMR,BOOMR.version||(BOOMR.version="0.9",BOOMR.window=a,function(){try{void 0!==new a.CustomEvent("CustomEvent")&&(f=function(b,c){return new a.CustomEvent(b,c)})}catch(b){}try{!f&&d.createEvent&&d.createEvent("CustomEvent")&&(f=function(a,b){var c=d.createEvent("CustomEvent");return b=b||{cancelable:!1,bubbles:!1},c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail),c})}catch(b){}!f&&d.createEventObject&&(f=function(a,b){var c=d.createEventObject();return c.type=c.propertyName=a,c.detail=b.detail,c}),f||(f=function(){return void 0})}(),b={beacon_url:"",beacon_type:"AUTO",site_domain:a.location.hostname.replace(/.*?([^.]+\.[^.]+)\.?$/,"$1").toLowerCase(),user_ip:"",strip_query_string:!1,onloadfired:!1,handlers_attached:!1,events:{page_ready:[],page_unload:[],dom_loaded:[],visibility_changed:[],before_beacon:[],onbeacon:[],xhr_load:[],click:[],form_submit:[]},public_events:{before_beacon:"onBeforeBoomerangBeacon",onbeacon:"onBoomerangBeacon",onboomerangloaded:"onBoomerangLoaded"},vars:{},errors:{},disabled_plugins:{},onclick_handler:function(c){var d;c||(c=a.event),c.target?d=c.target:c.srcElement&&(d=c.srcElement),3===d.nodeType&&(d=d.parentNode),d&&"OBJECT"===d.nodeName.toUpperCase()&&"application/x-shockwave-flash"===d.type||b.fireEvent("click",d)},onsubmit_handler:function(c){var d;c||(c=a.event),c.target?d=c.target:c.srcElement&&(d=c.srcElement),3===d.nodeType&&(d=d.parentNode),b.fireEvent("form_submit",d)},fireEvent:function(a,b){var c,d,e;if(a=a.toLowerCase(),!this.events.hasOwnProperty(a))return!1;for(this.public_events.hasOwnProperty(a)&&g(this.public_events[a],b),e=this.events[a],c=0;c0&&null!==a[e]&&"object"==typeof a[e]?d.push(this.objectToString(a[e],b+("\n	"===b?"	":""),c-1)):d.push(encodeURIComponent(a[e]));b=","}else for(e in a)Object.prototype.hasOwnProperty.call(a,e)&&(c>0&&null!==a[e]&&"object"==typeof a[e]?d.push(encodeURIComponent(e)+"="+this.objectToString(a[e],b+("\n	"===b?"	":""),c-1)):d.push(encodeURIComponent(e)+"="+encodeURIComponent(a[e])));return d.join(b)},getCookie:function(a){if(!a)return null;a=" "+a+"=";var b,c;return c=" "+d.cookie+";",(b=c.indexOf(a))>=0?(b+=a.length,c=c.substring(b,c.indexOf(";",b))):null},setCookie:function(a,c,e){var f,g,h,i,j;if(!a||!b.site_domain)return BOOMR.debug("No cookie name or site domain: "+a+"/"+b.site_domain),!1;if(f=this.objectToString(c,"&"),g=a+"="+f,i=[g,"path=/","domain="+b.site_domain],e&&(j=new Date,j.setTime(j.getTime()+1e3*e),j=j.toGMTString(),i.push("expires="+j)),g.length<500){if(d.cookie=i.join("; "),h=this.getCookie(a),f===h)return!0;BOOMR.warn("Saved cookie value doesn't match what we tried to set:\n"+f+"\n"+h)}else BOOMR.warn("Cookie too long: "+g.length+" "+g);return!1},getSubCookies:function(a){var b,c,d,e,f=!1,g={};if(!a)return null;if("string"!=typeof a)return BOOMR.debug("TypeError: cookie is not a string: "+typeof a),null;for(b=a.split("&"),c=0,d=b.length;d>c;c++)e=b[c].split("="),e[0]&&(e.push(""),g[decodeURIComponent(e[0])]=decodeURIComponent(e[1]),f=!0);return f?g:null},removeCookie:function(a){return this.setCookie(a,{},-86400)},cleanupURL:function(a){return a?b.strip_query_string?a.replace(/\?.*/,"?qs-redacted"):a:""},hashQueryString:function(a,b){return a?(a.match(/^\/\//)&&(a=location.protocol+a),a.match(/^(https?|file):/)?(b&&(a=a.replace(/#.*/,"")),BOOMR.utils.MD5?a.replace(/\?([^#]*)/,function(a,b){return"?"+(b.length>10?BOOMR.utils.MD5(b):b)}):a):(BOOMR.error("Passed in URL is invalid: "+a),"")):a},pluginConfig:function(a,b,c,d){var e,f=0;if(!b||!b[c])return!1;for(e=0;e0},addListener:function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)},removeListener:function(a,b,c){a.removeEventListener?a.removeEventListener(b,c,!1):a.detachEvent&&a.detachEvent("on"+b,c)},pushVars:function(a,b,c){var d,e,f=0;for(d in b)if(b.hasOwnProperty(d))if("[object Array]"===Object.prototype.toString.call(b[d]))for(e=0;e1?" (*"+b.errors[c]+")":""));return i.length>0&&(b.vars.errors=i.join("\n")),b.errors={},b.fireEvent("before_beacon",b.vars),b.beacon_url?(e=[],h=BOOMR.utils.pushVars(e,b.vars),this.setImmediate(b.fireEvent,"onbeacon",b.vars,b),h?(e=e.join("&"),"POST"===b.beacon_type?BOOMR.utils.postData(e):(f=b.beacon_url+(b.beacon_url.indexOf("?")>-1?"&":"?")+e,f.length>2e3&&"AUTO"===b.beacon_type?BOOMR.utils.postData(e):(BOOMR.debug("Sending url: "+f.replace(/&/g,"\n	")),g=new Image,g.src=f)),!0):this):(BOOMR.debug("No beacon_url, but would have sent: "+BOOMR.utils.objectToString(b.vars)),!0)}},delete BOOMR_start,"number"==typeof BOOMR_lstart?(c.t_lstart=BOOMR_lstart,delete BOOMR_lstart):"number"==typeof BOOMR.window.BOOMR_lstart&&(c.t_lstart=BOOMR.window.BOOMR_lstart),function(){var b;a.YAHOO&&a.YAHOO.widget&&a.YAHOO.widget.Logger?c.log=a.YAHOO.log:a.Y&&a.Y.log?c.log=a.Y.log:"object"==typeof console&&void 0!==console.log&&(c.log=function(a,b,c){console.log(c+": ["+b+"] "+a)}),b=function(a){return function(b,c){return this.log(b,a,"boomerang"+(c?"."+c:"")),this}},c.debug=b("debug"),c.info=b("info"),c.warn=b("warn"),c.error=b("error")}(),function(){var a;for(a in c)c.hasOwnProperty(a)&&(BOOMR[a]=c[a])}(),BOOMR.plugins=BOOMR.plugins||{},g("onBoomerangLoaded",{BOOMR:BOOMR}))}(window),function(){BOOMR=BOOMR||{},BOOMR.plugins=BOOMR.plugins||{};var a={complete:!1,done:function(){var b,c,d,e,a=BOOMR.window;if(this.complete)return this;if(b=a.performance||a.msPerformance||a.webkitPerformance||a.mozPerformance,b&&b.timing&&b.navigation){BOOMR.info("This user agent supports NavigationTiming.","nt"),c=b.navigation,d=b.timing;var f=d.navigationStart;navigator.userAgent.match(/Firefox\/[78]\./)&&(f=d.unloadEventStart||d.fetchStart||void 0),e={timeToFirstByte:d.responseStart-f,domProcessing:d.domContentLoadedEventEnd-d.responseStart,pageRendering:d.loadEventStart-d.domContentLoadedEventEnd,totalPageLoadTime:d.loadEventStart-f},BOOMR.addVar(e)}this.complete=!0,BOOMR.sendBeacon()}};BOOMR.plugins.javamelody={init:function(){return BOOMR.subscribe("page_ready",a.done,null,a),BOOMR.subscribe("page_unload",a.done,null,a),this},is_complete:function(){return a.complete}}}(),BOOMR.t_end=(new Date).getTime();




© 2015 - 2024 Weber Informatics LLC | Privacy Policy