diff --git a/README.md b/README.md index 8889131..446319d 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,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 ## Thanks diff --git a/bower.json b/bower.json index 2a85f91..d236f89 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "usertiming-compression", - "version": "0.1.1", + "version": "0.1.2", "homepage": "https://github.com/nicjansma/usertiming-compression.js", "authors": [ "Nic Jansma " diff --git a/package.json b/package.json index 1cabfe4..1946537 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "UserTiming compression and decompression", "main": "./src/usertiming-compression", "author": "Nic Jansma", - "version": "0.1.1", + "version": "0.1.2", "repository": { "type": "git", "url": "http://github.com/nicjansma/usertiming-compression.js.git" diff --git a/src/usertiming-compression.js b/src/usertiming-compression.js index f7462a6..633300a 100644 --- a/src/usertiming-compression.js +++ b/src/usertiming-compression.js @@ -90,6 +90,13 @@ } try { + // Try to access location.href first to trigger any Cross-Origin + // warnings. There's also a bug in Chrome ~48 that might cause + // the browser to crash if accessing X-O frame.performance. + // https://code.google.com/p/chromium/issues/detail?id=585871 + // This variable is not otherwise used. + var frameLoc = frame.location && frame.location.href; + if (!("performance" in frame) || !frame.performance || !frame.performance.getEntriesByType) {