@ -180,3 +180,15 @@ document.addEventListener('qortalExtensionRequests', async (event) => {
}
// Handle other request types as needed...
});
chrome.runtime.onMessage.addListener(function(message, sender, sendResponse) {
console.log({message})
if (message.type === "LOGOUT") {
// Notify the web page
window.postMessage({
type: "LOGOUT",
from: 'qortal'
}, "*");
@ -811,6 +811,12 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
// Handle error
console.error(chrome.runtime.lastError.message);
} else {
chrome.tabs.query({}, function(tabs) {
tabs.forEach(tab => {
console.log({tab})
chrome.tabs.sendMessage(tab.id, { type: "LOGOUT" });
// Data removed successfully
sendResponse(true);