Browse Source

take care of session storage as well

pull/2/head
gorhill 10 years ago
parent
commit
e187161b84
  1. 5
      src/js/contentscript-end.js

5
src/js/contentscript-end.js

@ -166,6 +166,7 @@ messaging.ask({
var localStorageHandler = function(mustRemove) { var localStorageHandler = function(mustRemove) {
if ( mustRemove ) { if ( mustRemove ) {
window.localStorage.clear(); window.localStorage.clear();
window.sessionStorage.clear();
// console.debug('HTTP Switchboard > found and removed non-empty localStorage'); // console.debug('HTTP Switchboard > found and removed non-empty localStorage');
} }
}; };
@ -175,7 +176,9 @@ var localStorageHandler = function(mustRemove) {
// to site data is disabled. // to site data is disabled.
// https://github.com/gorhill/httpswitchboard/issues/215 // https://github.com/gorhill/httpswitchboard/issues/215
try { 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({ messaging.ask({
what: 'contentScriptHasLocalStorage', what: 'contentScriptHasLocalStorage',
url: window.location.href url: window.location.href

Loading…
Cancel
Save