-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.js
More file actions
26 lines (20 loc) · 743 Bytes
/
popup.js
File metadata and controls
26 lines (20 loc) · 743 Bytes
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
chrome.storage.sync.get(['titleFirstLine'], function (items) {
let st = items.titleFirstLine;
document.getElementById('titleFirstLine').checked = st;
});
// document.getElementById('titleFirstLine').checked= true;
document.getElementById('titleFirstLine').addEventListener('click',
() => {
console.log('click received');
let st = document.getElementById('titleFirstLine').checked;
chrome.storage.sync.set({ 'titleFirstLine': st }, function () {
console.log('Settings saved', st);
// refresh current tab
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {
chrome.tabs.executeScript(
tabs[0].id,
{ code: 'location.reload()' });
});
});
}
)