-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
18 lines (15 loc) · 856 Bytes
/
popup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
window.onload = function () {
let count = document.querySelector('#renda_count');
let interval = document.querySelector('#renda_interval');
chrome.storage.local.get(['renda_count', 'renda_interval'], function (result) {
count.value = result.renda_count ? result.renda_count : 100;
interval.value = result.renda_interval ? result.renda_interval : 100;
});
}
const clickEvent = () => {
const count = document.querySelector('#renda_count').value ? document.querySelector('#renda_count').value : 100;
chrome.storage.local.set({ renda_count: count });
const interval = document.querySelector('#renda_interval').value ? document.querySelector('#renda_interval').value : 100;//ms
chrome.storage.local.set({ renda_interval: interval });
}
document.querySelector("#renda_set").addEventListener('click', clickEvent)