Skip to content

Commit

Permalink
Add optional options.window param in getCompressedUserTiming (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
querymetrics authored and nicjansma committed Jul 28, 2016
1 parent 2d18f66 commit e06b944
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# usertiming-compression.js

v0.1.0
v0.1.3

[http://nicj.net](http://nicj.net)

Expand Down Expand Up @@ -117,6 +117,7 @@ Gathers all UserTiming marks and measures from the root HTML page and all access
* `options.map`: A map of names to indexes to use for compression.
* `options.from`: The minimum `startTime`
* `options.to`: The maximum `startTime`
* `options.window`: window object that will be queried for UserTiming data

**Returns**: A map of names to compressed values.

Expand Down Expand Up @@ -203,6 +204,7 @@ Or via ``gulp``:
* v0.1.0 - 2015-12-10: Initial version
* v0.1.1 - 2016-04-04: `getCompressedUserTiming()` gathers Measures that end after the specified `from`
* v0.1.2 - 2016-04-04: Protect against X-O frame access that crashes some browsers
* v0.1.3 - 2016-07-25: `getCompressedUserTiming()` accepts an alternate window param passed into options

## Thanks

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "usertiming-compression",
"version": "0.1.2",
"version": "0.1.3",
"homepage": "https://github.com/nicjansma/usertiming-compression.js",
"authors": [
"Nic Jansma <nic@nicj.net>"
Expand Down
2 changes: 1 addition & 1 deletion dist/usertiming-compression.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/usertiming-decompression.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "UserTiming compression and decompression",
"main": "./src/usertiming-compression",
"author": "Nic Jansma",
"version": "0.1.2",
"version": "0.1.3",
"repository": {
"type": "git",
"url": "http://github.com/nicjansma/usertiming-compression.js.git"
Expand Down
4 changes: 3 additions & 1 deletion src/usertiming-compression.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,11 @@
* @returns {object} Compressed UserTiming entries
*/
UserTimingCompression.getCompressedUserTiming = function(options) {
var entries = this.findUserTimingForFrame(window);
var frame, entries;

options = options || {};
frame = options.window || window;
entries = this.findUserTimingForFrame(frame);

// 'from' minimum time
if (options.from) {
Expand Down

0 comments on commit e06b944

Please sign in to comment.