initial commit
This commit is contained in:
commit
95f5fdd3ea
19 files changed
+3050
No files matched your search
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* popup.js — UI logic for the extension popup.
|
||||
* Runs inside the popup iframe; uses chrome.runtime / chrome.storage APIs.
|
||||
*/
|
||||
|
||||
const actionBtn = document.getElementById('action-btn');
|
||||
const statusEl = document.getElementById('status');
|
||||
|
||||
actionBtn.addEventListener('click', async () => {
|
||||
// TODO: replace with actual extension logic
|
||||
try {
|
||||
const result = await chrome.storage.local.get(['counter']);
|
||||
const count = (result.counter ?? 0) + 1;
|
||||
await chrome.storage.local.set({ counter: count });
|
||||
statusEl.textContent = `Clicked ${count} time${count === 1 ? '' : 's'}`;
|
||||
} catch (err) {
|
||||
statusEl.textContent = `Error: ${err.message}`;
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user