addyosmani / timing.js

Navigation Timing API measurement helpers
1.5k stars 114 forks source link

ie8 doesn't safely fail #6

Open tbertenshaw opened 10 years ago

tbertenshaw commented 10 years ago

Want to encorporate this in our product behind a flag, however if the browser is ie8 (argh), ideally it just needs to fail silently without throwing a script error. Can we prevent the error for ie8?

Script throws an error

"'timing is null or not an object"

addyosmani commented 10 years ago

I assume the problematic line here is https://github.com/addyosmani/timing.js/blob/master/timing.js#L112 (where we auto-execute) with IE failing to create the object (possibly because of https://github.com/addyosmani/timing.js/blob/master/timing.js#L12). We can work around this. Will add a fix for the error later in the week if there's time.

Krinkle commented 7 years ago

Looks like this issue has been fixed meanwhile for #9, by https://github.com/addyosmani/timing.js/commit/6b082e6775c87104883b31d555ef26bfaaceb1a2.