Commit Graph

11 Commits

Author SHA1 Message Date
Ivo Julca
f74584f365 Fix cross-origin postMessage usage in Chrome Canary 2016-03-19 00:22:37 -05:00
Guangcong Luo
84ff3db560 Fix crash in Safari Private Browsing 2015-12-31 12:27:50 -05:00
sirDonovan
dd24ed5489 Avoid crashes from disabled cookies
Accessing localStorage when cookies are disabled throws a SecurityError in some browsers.
2015-12-30 03:57:30 -06:00
Guangcong Luo
367314c81a Fix HTTPS support in IE11
Apparently IE11 doesn't support location.origin. I assumed it had
wider support than it actually had.
2015-12-16 01:25:07 -05:00
Guangcong Luo
6dfc0bdabf Fix various bugs found by eslint 2015-12-07 03:20:30 -05:00
Guangcong Luo
cf8bb24e71 Refactor data storage
Data (teams and prefs) are now always stored in localStorage in the
`https://play.pokemonshowdown.com` origin. Data storage at a low
level has been mostly rewritten for this, and moved to storage.js.

Tools.prefs has been renamed Storage.prefs, although the API
Tools.prefs(prefName) is still available, and recommended for
battle.js (because storage.js isn't available in replays). All
other pref functionality, such as setting prefs and saving prefs,
should only be used in Storage.prefs.

If the browser blocks third-party cookies in a detectable way,
data is instead stored in the local origin.

As a final safety measure, prefs/teams are mirrored in the local origin
in case third-party cookies are blocked in an undetectable way.

This refactor also replaces the 'init:loadprefs' and 'init:loadteams'
events with a new load tracking system that's basically a simplified
implementation of Promises, documented in the comments for
Tools.makeLoadTracker().
2015-11-28 04:36:41 -05:00
Guangcong Luo
a6e56e969a Update jQuery to 2.1.4 2015-06-28 00:50:16 -04:00
Morfent
d2bc6dd260 Update jQuery to version 2.1.3 2015-02-06 05:07:58 -04:00
Guangcong Luo
a39c1078c4 Update links to jQuery and SockJS 2014-03-26 12:31:28 -05:00
Cathy J. Fitzpatrick
c76bd971a7 Fix critical bug in crossprotocol.html 2013-05-21 02:38:26 -05:00
Cathy J. Fitzpatrick
2c8d88a8e2 Add crossprotocol.html 2013-05-01 09:53:15 -06:00