Skip to content

Commit

Permalink
Conditionalize the navigator IE8 check.
Browse files Browse the repository at this point in the history
This caused a problem in gecko, where the jsm runs in an
environment without access to the navigator object.
  • Loading branch information
rillian committed Nov 30, 2015
1 parent 789a540 commit d14bb80
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/vtt.js
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,8 @@
// Constructs the computed display state of the cue (a div). Places the div
// into the overlay which should be a block level element (usually a div).
function CueStyleBox(window, cue, styleOptions) {
var isIE8 = (/MSIE\s8\.0/).test(navigator.userAgent);
var isIE8 = (typeof navigator !== "undefined") &&
(/MSIE\s8\.0/).test(navigator.userAgent);
var color = "rgba(255, 255, 255, 1)";
var backgroundColor = "rgba(0, 0, 0, 0.8)";
var textShadow = "";
Expand Down

0 comments on commit d14bb80

Please sign in to comment.