Export to GitHub

html5security - issue #6

html5sec.org requires DOM Storage


Posted on Feb 17, 2012 by Grumpy Bear

The contents of http://html5sec.org/ are not displayed, if user disabled DOM Storage of the browser. I want you to write the purport required DOM Storage for user who disabled that.

Comment #1

Posted on Jun 26, 2012 by Massive Lion

I would propose the following patch:

Eclipse Workspace Patch 1.0

P HTML5 Security Cheatsheet

Index: html/scripts/import.js

--- html/scripts/import.js (Revision 532) +++ html/scripts/import.js (Arbeitskopie) @@ -18,13 +18,15 @@ payloads = store.payloads; $('#offline').show(); }; - if(navigator.onLine) { - localStorage[location.hostname]=JSON.stringify( - {'items':items,'payloads':payloads,'categories':categories} - ); - $(window).bind('offline', offline); - $(window).bind('online', function(){$('#offline').hide()}) - $('#offline').hide(); + if(navigator.onLine || typeof navigator.onLine === 'undefined') { + try { + localStorage[location.hostname]=JSON.stringify( + {'items':items,'payloads':payloads,'categories':categories} + ); + $(window).bind('offline', offline); + $(window).bind('online', function(){$('#offline').hide()}) + $('#offline').hide(); + } catch(e){} } else { offline(); }

Could you please have a look if this works for you?

Status: Accepted

Labels:
Type-Defect Priority-Medium