ugly workarounds for firefox bug (https://bugzilla.mozilla.org/show_bug.cgi?id=748620).
also, do check for localStorage before loading settings.