From e187161b84bf593876b116e30b77f43b8d1bc53b Mon Sep 17 00:00:00 2001 From: gorhill Date: Sun, 26 Oct 2014 19:41:22 -0400 Subject: [PATCH] take care of session storage as well --- src/js/contentscript-end.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/js/contentscript-end.js b/src/js/contentscript-end.js index b4a350e..74a8c52 100644 --- a/src/js/contentscript-end.js +++ b/src/js/contentscript-end.js @@ -166,6 +166,7 @@ messaging.ask({ var localStorageHandler = function(mustRemove) { if ( mustRemove ) { window.localStorage.clear(); + window.sessionStorage.clear(); // console.debug('HTTP Switchboard > found and removed non-empty localStorage'); } }; @@ -175,7 +176,9 @@ var localStorageHandler = function(mustRemove) { // to site data is disabled. // https://github.com/gorhill/httpswitchboard/issues/215 try { - if ( window.localStorage && window.localStorage.length ) { + var hasLocalStorage = window.localStorage && window.localStorage.length; + var hasSessionStorage = window.sessionStorage && window.sessionStorage.length; + if ( hasLocalStorage || hasSessionStorage ) { messaging.ask({ what: 'contentScriptHasLocalStorage', url: window.location.href