mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-06-26 10:01:08 +12:00
take care of session storage as well
This commit is contained in:
parent
c0450c578d
commit
e187161b84
|
@ -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…
Reference in a new issue