-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.js
26 lines (22 loc) · 863 Bytes
/
popup.js
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
document.getElementById('find-image').addEventListener('click', () => {
// 立即执行
chrome.tabs.query({ active: true, currentWindow: true }, ([tab]) => {
chrome.storage.sync.set(
{ img2hubExec: true },
() => {
console.log("img2hubExec storage set: true");
}
);
chrome.scripting.executeScript({
target: { tabId: tab.id },
files: ['assets/js/img2hub.js']
});
});
});
// const bg = chrome.extension.getBackgroundPage()
document.getElementById('setting-hub-conf').addEventListener('click', () => {
window.open('options.html', '_blank');
});
const currentYear = new Date().getFullYear();
document.getElementById('copyright').innerHTML =
'© ' + currentYear + ' <a href="https://github.com/itcuihao" target="_blank">@haoc</a>';