-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackground.js
More file actions
27 lines (23 loc) · 953 Bytes
/
background.js
File metadata and controls
27 lines (23 loc) · 953 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 Service Worker for DeveloperTools Extension
// This runs in the background and handles extension lifecycle events
// Extension installation/update handler
chrome.runtime.onInstalled.addListener((details) => {
if (details.reason === 'install') {
console.log('DeveloperTools extension installed');
// Set default preferences
chrome.storage.local.set({
'theme': 'auto',
'version': chrome.runtime.getManifest().version
});
} else if (details.reason === 'update') {
console.log('DeveloperTools extension updated to', chrome.runtime.getManifest().version);
}
});
// Keep service worker alive (optional, for future features)
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
// Handle messages from popup if needed
if (request.action === 'ping') {
sendResponse({ status: 'alive' });
}
return true;
});