20 lines
563 B
JavaScript
20 lines
563 B
JavaScript
// Background service worker for the Page Editor extension
|
|
|
|
// Listen for extension icon click
|
|
chrome.action.onClicked.addListener((tab) => {
|
|
// Open popup or perform action
|
|
chrome.scripting.executeScript({
|
|
target: { tabId: tab.id },
|
|
function: () => {
|
|
console.log('Page Editor is active');
|
|
}
|
|
});
|
|
});
|
|
|
|
// Clean up old storage entries
|
|
chrome.storage.local.get(null, (items) => {
|
|
// Log storage usage
|
|
const storageSize = JSON.stringify(items).length;
|
|
console.log(`Page Editor storage usage: ${(storageSize / 1024).toFixed(2)} KB`);
|
|
});
|