h5bp/mobile-boilerplate

helper.js hideUrlBarOnLoad addEventListener needs 3rd arg for compatibility with firefox prior to 6

Closed this issue · 0 comments

My git-fu is weak, or I would submit a PR for this.

According to https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener
the third parameter for addEventListener was required prior to firefox 6 and I can confirm that its absence in the following area causes older versions of firefox to throw NS_ERROR_XPC_NOT_ENOUGH_ARGS and cause much havoc.

win.addEventListener('load', function() {
setTimeout(function() {
// at load, if user hasn't scrolled more than 20 or so...
if (MBP.getScrollTop() < 20) {
// reset to hide addr bar at onload
MBP.hideUrlBar();
}
}, 0);
});

The default behavior is false if not specified, so it is perhaps safe to just specify that?

Thanks for considering this and let me know if you need any additional info.

-sean