// Background Service Worker
import { backgroundHandler } from '../shared/messaging.js';

console.log('[SaladDict] Background service worker started');

// 监听安装事件
chrome.runtime.onInstalled.addListener((details) => {
  console.log('[SaladDict] Extension installed:', details.reason);
});

// BackgroundHandler 自动初始化消息监听
console.log('[SaladDict] Message handler initialized');

// 注册自定义消息处理器示例
backgroundHandler.register('ECHO', async (payload) => {
  return { echo: payload };
});
