Initial commit
This commit is contained in:
15
options.js
Normal file
15
options.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const favInput = document.getElementById('favcolor');
|
||||
const saveBtn = document.getElementById('save');
|
||||
const msg = document.getElementById('msg');
|
||||
|
||||
chrome.storage.sync.get(['favcolor']).then(data => {
|
||||
favInput.value = data.favcolor || '';
|
||||
});
|
||||
|
||||
saveBtn.addEventListener('click', () => {
|
||||
const val = favInput.value || '';
|
||||
chrome.storage.sync.set({ favcolor: val }).then(() => {
|
||||
msg.textContent = 'Saved.';
|
||||
setTimeout(() => (msg.textContent = ''), 1500);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user