tabswitcher/options.js
gmalvone aee213e96d Feat: Add configurable font setting and fix Windows font fallback
Added extension options page and configurable font settings. Fixed font fallback issue on Windows.
2026-01-29 16:34:39 +00:00

27 lines
No EOL
747 B
JavaScript

// options.js
// Save options to browser.storage
const saveOptions = () => {
const font = document.getElementById('font-family').value;
browser.storage.sync.set(
{ userFont: font }
).then(() => {
// Visual feedback
const status = document.getElementById('status');
status.style.opacity = '1';
setTimeout(() => {
status.style.opacity = '0';
}, 1500);
});
};
// Restore options from browser.storage
const restoreOptions = () => {
browser.storage.sync.get('userFont').then((result) => {
document.getElementById('font-family').value = result.userFont || '';
});
};
document.addEventListener('DOMContentLoaded', restoreOptions);
document.getElementById('save').addEventListener('click', saveOptions);