-
Notifications
You must be signed in to change notification settings - Fork 0
/
popup.js
24 lines (24 loc) · 867 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
$(document).ready(() => {
chrome.storage.local.get(['ExtensionOn', 'Opacity'], function(data) {
$('#CheckboxExt')[0].checked = data.ExtensionOn;
$('#ValuebarExt')[0].value = data.Opacity;
});
$('#CheckboxExt').click(function () {
chrome.storage.local.set({ExtensionOn: $(this)[0].checked}, () =>
chrome.tabs.query({}, (tabs) =>
tabs.forEach((tab) =>
chrome.tabs.sendMessage(tab.id, "ExtensionOn")
)
)
);
});
$('#ValuebarExt')[0].onchange = function () {
chrome.storage.local.set({Opacity: this.value}, () =>
chrome.tabs.query({}, (tabs) =>
tabs.forEach((tab) =>
chrome.tabs.sendMessage(tab.id, "Opacity")
)
)
);
};
});