Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion 13 modern/unassembled/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,18 @@ var NOW = 1
* LOCAL STORAGE
*/
var db = (function(){
var ls = typeof localStorage != 'undefined' && localStorage;
try {
var ls = typeof localStorage != 'undefined' && localStorage;
} catch (e) {
var ls = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; },
removeItem : function(id) { return delete this._data[id]; },
clear : function() { return this._data = {}; }
}
}

return {
get : function(key) {
try {
Expand Down
1 change: 1 addition & 0 deletions 1 web/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -2660,6 +2660,7 @@ console.log || (
*/
var db = (function(){
var ls = window['localStorage'];

return {
'get' : function(key) {
try {
Expand Down
12 changes: 11 additions & 1 deletion 12 web/unassembled/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@ console.log || (
* LOCAL STORAGE OR COOKIE
*/
var db = (function(){
var ls = window['localStorage'];
try {
var ls = window['localStorage'];
} catch (e) {
var ls = {
_data : {},
setItem : function(id, val) { return this._data[id] = String(val); },
getItem : function(id) { return this._data.hasOwnProperty(id) ? this._data[id] : undefined; },
removeItem : function(id) { return delete this._data[id]; },
clear : function() { return this._data = {}; }
}
}
return {
'get' : function(key) {
try {
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.