feat: url cleaner tool and extension update

This commit is contained in:
2026-02-27 06:11:12 +00:00
parent efe23a99ac
commit 7d989be27f
4 changed files with 37 additions and 2 deletions

View File

@@ -42,12 +42,24 @@ setInterval(async () => {
}
}, 50);
// Listen for messages from background if we need to change behavior
// Listen for messages from background
chrome.runtime.onMessage.addListener((message) => {
if (message.target === 'offscreen') {
// Handle commands
if (message.type === 'play-sound') {
playNotificationSound();
} else if (message.type === 'write-clipboard') {
try {
const text = message.data;
if (text) {
textEl.value = text;
textEl.select();
document.execCommand('copy');
lastText = text; // Update internal state to avoid re-triggering update
}
} catch (e) {
console.error('Failed to write clipboard:', e);
}
}
}
});