client/boomerang-rt.js
function() {
		var ti, p, source;

		if(this.navigationStart) {
			return;
		}

		// Get start time from WebTiming API see:
		// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
		// http://blogs.msdn.com/b/ie/archive/2010/06/28/measuring-web-page-performance.aspx
		// http://blog.chromium.org/2010/07/do-you-know-how-slow-your-web-page-is.html
		p = w.performance || w.msPerformance || w.webkitPerformance || w.mozPerformance;

		if(p && p.navigation) {
			this.navigationType = p.navigation.type;
		}

		if(p && p.timing) {
			ti = p.timing;
		}
		else if(w.chrome && w.chrome.csi && w.chrome.csi().startE) {
			// Older versions of chrome also have a timing API that's sort of documented here:
			// http://ecmanaut.blogspot.com/2010/06/google-bom-feature-ms-since-pageload.html
			// source here:
			// http://src.chromium.org/viewvc/chrome/trunk/src/chrome/renderer/loadtimes_extension_bindings.cc?view=markup
			ti = {
				navigationStart: w.chrome.csi().startE
			};
			source = "csi";
		}
		else if(w.gtbExternal && w.gtbExternal.startE()) {
			// The Google Toolbar exposes navigation start time similar to old versions of chrome
			// This would work for any browser that has the google toolbar installed
			ti = {
				navigationStart: w.gtbExternal.startE()
			};
			source = "gtb";
		}

		if(ti) {
			// Always use navigationStart since it falls back to fetchStart (not with redirects)
			// If not set, we leave t_start alone so that timers that depend
			// on it don't get sent back.  Never use requestStart since if
			// the first request fails and the browser retries, it will contain
			// the value for the new request.
			BOOMR.addVar("rt.start", source || "navigation");
			this.navigationStart = ti.navigationStart || ti.fetchStart || undefined;
			this.responseStart = ti.responseStart || undefined;

			// bug in Firefox 7 & 8 https://bugzilla.mozilla.org/show_bug.cgi?id=691547
			if(navigator.userAgent.match(/Firefox\/[78]\./)) {
				this.navigationStart = ti.unloadEventStart || ti.fetchStart || undefined;
			}
		}
		else {
			BOOMR.warn("This browser doesn't support the WebTiming API", "rt");
		}

		return;
	}
function() {
		var ti, p, source;

		if(this.navigationStart) {
			return;
		}

		// Get start time from WebTiming API see:
		// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html
		// http://blogs.msdn.com/b/ie/archive/2010/06/28/measuring-web-page-performance.aspx
		// http://blog.chromium.org/2010/07/do-you-know-how-slow-your-web-page-is.html
		p = w.performance || w.msPerformance || w.webkitPerformance || w.mozPerformance;

		if(p && p.navigation) {
			this.navigationType = p.navigation.type;
		}

		if(p && p.timing) {
			ti = p.timing;
		}
		else if(w.chrome && w.chrome.csi && w.chrome.csi().startE) {
			// Older versions of chrome also have a timing API that's sort of documented here:
			// http://ecmanaut.blogspot.com/2010/06/google-bom-feature-ms-since-pageload.html
			// source here:
			// http://src.chromium.org/viewvc/chrome/trunk/src/chrome/renderer/loadtimes_extension_bindings.cc?view=markup
			ti = {
				navigationStart: w.chrome.csi().startE
			};
			source = "csi";
		}
		else if(w.gtbExternal && w.gtbExternal.startE()) {
			// The Google Toolbar exposes navigation start time similar to old versions of chrome
			// This would work for any browser that has the google toolbar installed
			ti = {
				navigationStart: w.gtbExternal.startE()
			};
			source = "gtb";
		}

		if(ti) {
			// Always use navigationStart since it falls back to fetchStart (not with redirects)
			// If not set, we leave t_start alone so that timers that depend
			// on it don't get sent back.  Never use requestStart since if
			// the first request fails and the browser retries, it will contain
			// the value for the new request.
			BOOMR.addVar("rt.start", source || "navigation");
			this.navigationStart = ti.navigationStart || ti.fetchStart || undefined;
			this.responseStart = ti.responseStart || undefined;

			// bug in Firefox 7 & 8 https://bugzilla.mozilla.org/show_bug.cgi?id=691547
			if(navigator.userAgent.match(/Firefox\/[78]\./)) {
				this.navigationStart = ti.unloadEventStart || ti.fetchStart || undefined;
			}
		}
		else {
			BOOMR.warn("This browser doesn't support the WebTiming API", "rt");
		}

		return;
	}
function ( ) { var ti , p , source ; if ( this . navigationStart ) { return ; } // Get start time from WebTiming API see: // https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html // http://blogs.msdn.com/b/ie/archive/2010/06/28/measuring-web-page-performance.aspx // http://blog.chromium.org/2010/07/do-you-know-how-slow-your-web-page-is.html p = w . performance || w . msPerformance || w . webkitPerformance || w . mozPerformance ; if ( p && p . navigation ) { this . navigationType = p . navigation . type ; } if ( p && p . timing ) { ti = p . timing ; } else if ( w . chrome && w . chrome . csi && w . chrome . csi ( ) . startE ) { // Older versions of chrome also have a timing API that's sort of documented here: // http://ecmanaut.blogspot.com/2010/06/google-bom-feature-ms-since-pageload.html // source here: // http://src.chromium.org/viewvc/chrome/trunk/src/chrome/renderer/loadtimes_extension_bindings.cc?view=markup ti = { navigationStart : w . chrome . csi ( ) . startE } ; source = "csi" ; } else if ( w . gtbExternal && w . gtbExternal . startE ( ) ) { // The Google Toolbar exposes navigation start time similar to old versions of chrome // This would work for any browser that has the google toolbar installed ti = { navigationStart : w . gtbExternal . startE ( ) } ; source = "gtb" ; } if ( ti ) { // Always use navigationStart since it falls back to fetchStart (not with redirects) // If not set, we leave t_start alone so that timers that depend // on it don't get sent back.  Never use requestStart since if // the first request fails and the browser retries, it will contain // the value for the new request. BOOMR . addVar ( "rt.start" , source || "navigation" ) ; this . navigationStart = ti . navigationStart || ti . fetchStart || undefined ; this . responseStart = ti . responseStart || undefined ; // bug in Firefox 7 & 8 https://bugzilla.mozilla.org/show_bug.cgi?id=691547 if ( navigator . userAgent . match ( / Firefox\/[78]\. / ) ) { this . navigationStart = ti . unloadEventStart || ti . fetchStart || undefined ; } } else { BOOMR . warn ( "This browser doesn't support the WebTiming API" , "rt" ) ; } return ; }
Initialise timers from the NavigationTiming API.  This method looks at various sources for
Navigation Timing, and also patches around bugs in various browser implementations.
It sets the beacon parameter `rt.start` to the source of the timer
Initialise timers from the NavigationTiming API . This method looks at various sources for Navigation Timing and also patches around bugs in various browser implementations . It sets the beacon parameter rt . start to the source of the timer