document.addEventListener('DOMContentLoaded', function() {
    document.querySelectorAll('.deactivate a').forEach(function(element) {
        element.addEventListener('click', function(e) {
            var href = this.getAttribute('href');
              e.preventDefault(); // Prevent the default deactivation action
                if (window.localStorage) {
                  localStorage.setItem("app_Title", ""); // or use a default value like "Default Title"
                  localStorage.setItem("settings", "{}"); // or use a default settings JSON object
                  localStorage.setItem("app_Title_gutenberg_block", ""); 
                }
                window.location.href = href; // Proceed with the deactivation
        });
    });
});
