remove background.js

This commit is contained in:
bob.rao
2023-04-25 10:22:56 +08:00
parent 6655cd86e4
commit e8095e3d3e

View File

@@ -1,16 +0,0 @@
console.log('Sending checkedIndexes from background:', checkedIndexes);
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
chrome.tabs.sendMessage(tabs[0].id, { type: 'checkedIndexes', checkedIndexes: checkedIndexes });
});
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
if (request.type === 'setCheckedIndexes') {
chrome.storage.local.set({ checkedIndexes: request.checkedIndexes });
} else if (request.type === 'getCheckedIndexes') {
chrome.storage.local.get(['checkedIndexes'], (result) => {
sendResponse(result.checkedIndexes || []);
});
return true;
}
});