1
0
mirror of https://github.com/maximebf/php-debugbar.git synced 2025-07-25 10:41:55 +02:00

Use localstorage

This commit is contained in:
Barry vd. Heuvel
2024-03-19 21:50:30 +01:00
parent bbff3da233
commit 19fb0ce8aa

View File

@@ -1068,8 +1068,8 @@ if (typeof(PhpDebugBar) == 'undefined') {
var AjaxHandler = PhpDebugBar.AjaxHandler = function(debugbar, headerName, autoShow) { var AjaxHandler = PhpDebugBar.AjaxHandler = function(debugbar, headerName, autoShow) {
this.debugbar = debugbar; this.debugbar = debugbar;
this.headerName = headerName || 'phpdebugbar'; this.headerName = headerName || 'phpdebugbar';
if (sessionStorage.getItem('phpdebugbar-ajaxhandler-autoshow') !== null) { if (localStorage.getItem('phpdebugbar-ajaxhandler-autoshow') !== null) {
this.autoShow = JSON.parse(sessionStorage.getItem('phpdebugbar-ajaxhandler-autoshow')); this.autoShow = localStorage.getItem('phpdebugbar-ajaxhandler-autoshow') == '1';
} else { } else {
this.autoShow = typeof(autoShow) == 'undefined' ? true : autoShow; this.autoShow = typeof(autoShow) == 'undefined' ? true : autoShow;
} }
@@ -1115,7 +1115,7 @@ if (typeof(PhpDebugBar) == 'undefined') {
setAutoShow: function(autoshow) { setAutoShow: function(autoshow) {
this.autoShow = autoshow; this.autoShow = autoshow;
sessionStorage.setItem('phpdebugbar-ajaxhandler-autoshow', JSON.stringify(autoshow)); localStorage.setItem('phpdebugbar-ajaxhandler-autoshow', autoshow ? '1' : '0');
}, },
/** /**