Show More
Commit Description:
- clean up link to problem stat and user stat...
Commit Description:
- clean up link to problem stat and user stat (grafted from 45d1e12e9794a23a5431222fe2f4c7461d73a529)
File last commit:
Show/Diff file:
Action:
lib/assets/Lib/browser/session_storage.py | 19 lines | 517 B | text/x-python | PythonLexer |
# session storage in browser
import sys
from javascript import JSObject
from browser import window
from .local_storage import LocalStorage
has_session_storage = hasattr(window, 'sessionStorage')
class SessionStorage(LocalStorage):
storage_type = "session_storage"
def __init__(self):
if not has_session_storage:
raise EnvironmentError("SessionStorage not available")
self.store = window.sessionStorage
if has_session_storage:
storage = SessionStorage()