-
Notifications
You must be signed in to change notification settings - Fork 1
/
popup.js
27 lines (23 loc) · 948 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.addEventListener('DOMContentLoaded', function () {
let max = document.querySelector('#max');
let min = document.querySelector('#min');
let bmin = document.querySelector('#bmin');
let bmax = document.querySelector('#bmax');
let filterBtn = document.querySelector('#filter-btn');
let resetBtn = document.querySelector('#reset-btn');
filterBtn.addEventListener('click', function (ev) {
chrome.tabs.query({active: true, currentWindow: true}, function (tabs) {
chrome.tabs.sendMessage(tabs[0].id, {
max: max.value,
min: min.value,
bmin: bmin.value,
bmax: bmax.value
});
});
});
resetBtn.addEventListener('click', function (ev) {
chrome.tabs.query({active: true, currentWindow: true}, function (tabs) {
chrome.tabs.sendMessage(tabs[0].id, {action: 'reset'})
})
});
});