Page MenuHomePhabricator

Recover when cookies are disabled in Firefox and accessing localStorage throws

Authored by epriestley on Sat, Nov 24, 2:25 PM.



Ref T13216. See PHI985. If you disable cookies in Firefox, accessing window.localStorage throws an exception. Currently, this pretty much kills all scripts on the page.

Instead, catch and ignore this, as though window.localStorage was not defined.

Test Plan
  • Set Firefox to "no cookies".
  • Loaded any page while logged out.
  • Before: JS fatal early in the stack.
  • After: page loads and JS works.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Sat, Nov 24, 2:25 PM
epriestley requested review of this revision.Sat, Nov 24, 2:27 PM
amckinley accepted this revision.Mon, Nov 26, 4:48 PM
This revision is now accepted and ready to land.Mon, Nov 26, 4:48 PM
This revision was automatically updated to reflect the committed changes.