feat: CSP Violation ( 感叹号图标被拦截 )
All checks were successful
Extension Build & Release / build (push) Successful in 48s
All checks were successful
Extension Build & Release / build (push) Successful in 48s
This commit is contained in:
@@ -9,7 +9,19 @@ const API_BASE = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8080/api
|
||||
|
||||
chrome.runtime.onMessage.addListener((message: { type: string; payload?: any }, _sender: chrome.runtime.MessageSender, sendResponse: (response?: any) => void) => {
|
||||
if (message.type === 'SHOW_INSIGHT') {
|
||||
console.log('Received tweet data in background:', message.payload);
|
||||
console.log('[InsightReply Background] Received SHOW_INSIGHT data:', message.payload);
|
||||
if (_sender.tab?.id) {
|
||||
console.log(`[InsightReply Background] Forwarding SHOW_INSIGHT to tab ${_sender.tab.id}`);
|
||||
chrome.tabs.sendMessage(_sender.tab.id, message, (response) => {
|
||||
if (chrome.runtime.lastError) {
|
||||
console.error('[InsightReply Background] Error forwarding message to tab:', chrome.runtime.lastError);
|
||||
} else {
|
||||
console.log('[InsightReply Background] Successfully forwarded to tab, response:', response);
|
||||
}
|
||||
});
|
||||
}
|
||||
sendResponse({ success: true, forwarded: !!_sender.tab?.id });
|
||||
return true;
|
||||
}
|
||||
|
||||
if (message.type === 'FETCH_CUSTOM_STRATEGIES') {
|
||||
|
||||
Reference in New Issue
Block a user