Feat: Add configurable font setting and fix Windows font fallback

Added extension options page and configurable font settings. Fixed font fallback issue on Windows.
This commit is contained in:
gmalvone 2026-01-29 16:34:39 +00:00
commit aee213e96d
5 changed files with 92 additions and 9 deletions

27
options.js Normal file
View file

@ -0,0 +1,27 @@
// 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);