Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix #53, handle non-standard setTimeout lateness.

Firefox < 13 passes an numeric argument, lateness, to
the callback for `setTimeout, which caused $yetify to re-init.

Verify the config argument is an object, instead of a number.

See: https://developer.mozilla.org/en/window.setTimeout
  • Loading branch information...
commit d9a26f9737a88fb0d3b3c6ea13a32b0120aca140 1 parent e70cc41
@reid reid authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/hub/view/public/inject.js
View
7 lib/hub/view/public/inject.js
@@ -44,7 +44,6 @@ function $yetify(firstRunConfiguration) {
// TODO Throttle test navigation for Opera and slow mobile devices.
socket.on("complete", function () {
- if (!config.mountpoint) return;
document.location.href = config.mountpoint;
});
@@ -53,7 +52,11 @@ function $yetify(firstRunConfiguration) {
});
}
- if (firstRunConfiguration) {
+ // $yetify will be called again from setTimeout.
+ // In Firefox < 13, the first argument may be a `lateness` argument.
+ // https://developer.mozilla.org/en/window.setTimeout
+ // Make sure this argument is an object before initializing.
+ if ("object" === typeof firstRunConfiguration) {
init(firstRunConfiguration);
if (document.compatMode !== "CSS1Compat") {
throw new Error("Yeti requires HTML files with doctypes.");
Please sign in to comment.
Something went wrong with that request. Please try again.