Skip to content

Commit 962dfb6

Browse files
committed
Initialize
0 parents  commit 962dfb6

File tree

8 files changed

+838
-0
lines changed

8 files changed

+838
-0
lines changed

background.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
chrome.runtime.onInstalled.addListener(function(details) {
2+
console.log('元素移除器插件已安装');
3+
4+
chrome.storage.sync.set({
5+
keywords: [],
6+
isEnabled: true
7+
});
8+
});
9+
10+
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
11+
if (request.action === 'getKeywords') {
12+
chrome.storage.sync.get(['keywords'], function(result) {
13+
sendResponse({keywords: result.keywords || []});
14+
});
15+
return true;
16+
}
17+
18+
if (request.action === 'saveKeywords') {
19+
chrome.storage.sync.set({keywords: request.keywords}, function() {
20+
sendResponse({success: true});
21+
});
22+
return true;
23+
}
24+
});
25+
26+
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
27+
if (changeInfo.status === 'complete' && tab.url) {
28+
console.log('页面加载完成:', tab.url);
29+
}
30+
});
31+
32+
chrome.action.onClicked.addListener(function(tab) {
33+
});

0 commit comments

Comments
 (0)