@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Recover when cookies are disabled in Firefox and accessing localStorage throws

Summary:
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.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13216

Differential Revision: https://secure.phabricator.com/D19832

+9 -4
+2 -2
resources/celerity/map.php
··· 213 213 'rsrc/externals/javelin/core/__tests__/install.js' => 'c432ee85', 214 214 'rsrc/externals/javelin/core/__tests__/stratcom.js' => '88bf7313', 215 215 'rsrc/externals/javelin/core/__tests__/util.js' => 'e251703d', 216 - 'rsrc/externals/javelin/core/init.js' => '638a4e2b', 216 + 'rsrc/externals/javelin/core/init.js' => '8d83d2a1', 217 217 'rsrc/externals/javelin/core/init_node.js' => 'c234aded', 218 218 'rsrc/externals/javelin/core/install.js' => '05270951', 219 219 'rsrc/externals/javelin/core/util.js' => '93cc50d6', ··· 694 694 'javelin-install' => '05270951', 695 695 'javelin-json' => '69adf288', 696 696 'javelin-leader' => '7f243deb', 697 - 'javelin-magical-init' => '638a4e2b', 697 + 'javelin-magical-init' => '8d83d2a1', 698 698 'javelin-mask' => '8a41885b', 699 699 'javelin-quicksand' => '6b8ef10b', 700 700 'javelin-reactor' => '2b8de964',
+7 -2
webroot/rsrc/externals/javelin/core/init.js
··· 214 214 'mouseup' 215 215 ]; 216 216 217 - if (window.localStorage) { 218 - window_events.push('storage'); 217 + try { 218 + if (window.localStorage) { 219 + window_events.push('storage'); 220 + } 221 + } catch (storage_exception) { 222 + // See PHI985. In Firefox, accessing "window.localStorage" may throw an 223 + // exception if cookies are disabled. 219 224 } 220 225 221 226 for (ii = 0; ii < window_events.length; ++ii) {