Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
110 lines (99 sloc) 4.99 KB
<!DOCTYPE HTML>
<html>
<head>
<title>Navigation Timing plugin API</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../boomerang-docs.css">
</head>
<body>
<span style="float:right;"><a href="../">All Docs</a> | <a href="index.html">Index</a></span>
<h1>Navigation Timing plugin API</h1>
<p>
<strong>Note:</strong> The Navigation Timing plugin hasn't been tested. Your help in testing it is appreciated.
</p>
<p>
The Navigation Timing plugin collects metrics collected by modern user agents that support the
<a href="http://w3c-test.org/webperf/specs/NavigationTiming/">W3C Navigation Timing</a> specification. The Navigation
Timing API is encapsulated within the <code>BOOMR.plugins.NavigationTiming</code> namespace.
</p>
<p>
<strong>Note</strong> that the Navigation Timing plugin isn't included by default in boomerang.js. See
<a href="../howtos/howto-9.html">Howto #9</a> for details on how to include the plugin in your boomerang
deployment.
</p>
<h2 id="methods">Methods</h2>
<dl class="api">
<dt>init()</dt>
<dd>
<p>
Called by the <a href="BOOMR.html#init">BOOMR.init()</a> method to configure the Navigation Timing
plugin. The Navigation Timing plugin doesn't require any configuration parameters, since it simply
reads values out of the browser's <code>window.performance</code> object (if available) and adds them to the
beacon query string.
</p>
<h3>Returns</h3>
<p>
a reference to the <code>BOOMR.plugins.NavigationTiming</code> object, so you can chain methods.
</p>
<h3>Note</h3>
<p>
If the user agent being examined doesn't implement the Navigation Timing spec, the plugin won't
add any parameters to the beacon.
</p>
</dd>
<dt>is_complete()</dt>
<dd>
<p>
Called by <a href="BOOMR.html#sendBeacon">BOOMR.sendBeacon()</a> to determine
if the Navigation Timing plugin has finished what it's doing or not.
</p>
<h3>Returns</h3>
<ul>
<li><code>true</code> if the plugin has completed.</li>
<li><code>false</code> if the plugin has not completed.</li>
</ul>
</dd>
</dl>
<h2 id="beacon">Beacon Parameters</h2>
<p>
The NavigationTiming plugin adds the following parameters to the beacon. Each maps onto a attribute from the
browser's NavigationTiming API.
</p>
<table>
<tr>
<th>Beacon parameter</th>
<th>NavigationTiming attribute</th>
</tr>
<tr><td><code>nt_red_cnt</code></td><td><code>window.performance.navigation.redirectCount</code></td></tr>
<tr><td><code>nt_nav_type</code></td><td><code>window.performance.navigation.type</code></td></tr>
<tr><td><code>nt_nav_st</code></td><td><code>window.performance.timing.navigationStart</code></td></tr>
<tr><td><code>nt_red_st</code></td><td><code>window.performance.timing.redirectStart</code></td></tr>
<tr><td><code>nt_red_end</code></td><td><code>window.performance.timing.redirectEnd</code></td></tr>
<tr><td><code>nt_fet_st</code></td><td><code>window.performance.timing.fetchStart</code></td></tr>
<tr><td><code>nt_dns_st</code></td><td><code>window.performance.timing.domainLookupStart</code></td></tr>
<tr><td><code>nt_dns_end</code></td><td><code>window.performance.timing.domainLookupEnd</code></td></tr>
<tr><td><code>nt_con_st</code></td><td><code>window.performance.timing.connectStart</code></td></tr>
<tr><td><code>nt_con_end</code></td><td><code>window.performance.timing.connectEnd</code></td></tr>
<tr><td><code>nt_req_st</code></td><td><code>window.performance.timing.requestStart</code></td></tr>
<tr><td><code>nt_res_st</code></td><td><code>window.performance.timing.responseStart</code></td></tr>
<tr><td><code>nt_res_end</code></td><td><code>window.performance.timing.responseEnd</code></td></tr>
<tr><td><code>nt_domloading</code></td><td><code>window.performance.timing.domLoading</code></td></tr>
<tr><td><code>nt_domint</code></td><td><code>window.performance.timing.domInteractive</code></td></tr>
<tr><td><code>nt_domcontloaded_st</code></td><td><code>window.performance.timing.domContentLoadedEventStart</code></td></tr>
<tr><td><code>nt_domcontloaded_end</code></td><td><code>window.performance.timing.domContentLoadedEventEnd</code></td></tr>
<tr><td><code>nt_domcomp</code></td><td><code>window.performance.timing.domComplete</code></td></tr>
<tr><td><code>nt_load_st</code></td><td><code>window.performance.timing.loadEventStart</code></td></tr>
<tr><td><code>nt_load_end</code></td><td><code>window.performance.timing.loadEventEnd</code></td></tr>
<tr><td><code>nt_unload_st</code></td><td><code>window.performance.timing.unloadEventStart</code></td></tr>
<tr><td><code>nt_unload_end</code></td><td><code>window.performance.timing.unloadEventEnd</code></td></tr>
<tr><td><code>nt_ssl_st</code></td><td><strong>[optional]</strong> <code>window.performance.secureConnectionStart</code></td></tr>
</table>
<p class="perma-link">
The latest code and docs is available on <a href="http://github.com/lognormal/boomerang/">github.com/lognormal/boomerang</a>
</p>
</body>
</html>
<!--
Copyright (c) Buddy Brewer. All rights reserved.
Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms.
-->
Something went wrong with that request. Please try again.