-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbackground.js
More file actions
27 lines (22 loc) · 803 Bytes
/
background.js
File metadata and controls
27 lines (22 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Background script for Interzept Chrome Extension
console.log('Interzept background script loaded');
// Handle extension installation
chrome.runtime.onInstalled.addListener((details) => {
console.log('Interzept extension installed/updated:', details.reason);
});
// Handle extension startup
chrome.runtime.onStartup.addListener(() => {
console.log('Interzept extension started');
});
// Optional: Handle messages from content scripts or popup
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
console.log('Background received message:', request);
switch (request.action) {
case 'openOptions':
chrome.runtime.openOptionsPage();
break;
default:
console.log('Unknown action:', request.action);
}
sendResponse({ success: true });
});