mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-05 09:27:25 +00:00
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:
parent
5bc492d866
commit
aee213e96d
5 changed files with 92 additions and 9 deletions
27
options.js
Normal file
27
options.js
Normal 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);
|
||||
Loading…
Add table
Add a link
Reference in a new issue