forked from ao5357/page-to-wireframe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.js
More file actions
22 lines (19 loc) · 778 Bytes
/
Copy pathoptions.js
File metadata and controls
22 lines (19 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// options.js
document.addEventListener('DOMContentLoaded', () => {
const fontSelection = document.getElementById('font-selection');
// Load the saved font setting from chrome.storage
chrome.storage.sync.get(['selectedFont'], (result) => {
if (result.selectedFont) {
fontSelection.value = result.selectedFont;
} else {
fontSelection.value = 'script'; // Default to 'script' if not set
}
});
// Save the selected font setting when the user selects a new font
fontSelection.addEventListener('change', () => {
const selectedFont = fontSelection.value;
chrome.storage.sync.set({ selectedFont }, () => {
console.log('Font setting updated:', selectedFont);
});
});
});