Changeset 36444

Show
Ignore:
Timestamp:
01/15/10 04:05:36 (3 years ago)
Author:
NeoCat
Message:

try-catch on accessing localStorage

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • websites/twicli/twicli.html

    r36414 r36444  
    4545.tome { background-color: #ccf; } 
    4646.emp { background-color: #fcc; } 
     47.non-follower { color: #008; } 
    4748.retweeted { color: #555; } 
    48 .non-follower { color: #008; } 
    4949.button { text-decoration: none; -webkit-text-size-adjust:140%; } 
    5050.popup { padding: 0 4px; color: #888; } 
     
    214214if (!window.localStorage) window.localStorage = window.globalStorage && window.globalStorage[location.hostname]; 
    215215function readCookie(key) { 
    216         if (window.localStorage && window.localStorage["twicli_"+key]) 
    217                 return String(window.localStorage["twicli_"+key]); 
     216        try { 
     217                if (window.localStorage && window.localStorage["twicli_"+key]) 
     218                        return String(window.localStorage["twicli_"+key]); 
     219        } catch(e) { return null; } 
    218220        key += "="; 
    219221        var scookie = document.cookie + ";"; 
     
    227229function writeCookie(key, val, days) { 
    228230        if (window.localStorage) 
    229                 window.localStorage["twicli_"+key] = val; 
     231                try { window.localStorage["twicli_"+key] = val; } catch(e) {} 
    230232        else { 
    231233                var sday = new Date();