diff --git a/src/manifest.json b/src/manifest.json index 28995e7..3c7cdca 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "name": "Page load time", - "version": "1.2.2", + "version": "1.2.3", "manifest_version": 2, "description": "Displays page load time in the toolbar", "background": { diff --git a/src/timer.js b/src/timer.js index 2c90738..31c937b 100644 --- a/src/timer.js +++ b/src/timer.js @@ -12,8 +12,16 @@ if (t.loadEventEnd > 0) { // we have only 4 chars in our disposal including decimal point var time = String(((t.loadEventEnd - start) / 1000).toPrecision(3)).substring(0, 4); - var roe = chrome.runtime && chrome.runtime.sendMessage ? 'runtime' : 'extension'; - chrome[roe].sendMessage({time: time, timing: t}); + var roe = chrome.runtime && chrome.runtime.sendMessage ? 'runtime' : 'extension'; + + // since Chrome 43 JSON.stringify() doesn't work for PerformanceTiming + // https://code.google.com/p/chromium/issues/detail?id=467366 + // need to manually copy properties via for .. in loop + var timing = {}; + for (p in t) { + timing[p] = t[p]; + } + chrome[roe].sendMessage({time: time, timing: timing}); } }, 0); }