mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-04 17:07:23 +00:00
Added extension options page and configurable font settings. Fixed font fallback issue on Windows.
27 lines
No EOL
747 B
JavaScript
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); |