This commit is contained in:
gmalvone 2026-01-29 17:09:42 +00:00 committed by GitHub
commit 09c17d478c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 92 additions and 9 deletions

View file

@ -1,9 +1,16 @@
{
"manifest_version": 3,
"name": "Tabswitcher",
"version": "1.1.2",
"description": "The musthave extension for a mouse-free Firefox experience",
"homepage_url": "https://github.com/He4eT/tabswitcher",
"action": {
"default_title": "Tabswitcher"
},
"background": {
"scripts": ["background.js"]
"scripts": [
"background.js"
]
},
"browser_specific_settings": {
"gecko": {
@ -18,13 +25,13 @@
}
}
},
"description": "The musthave extension for a mouse-free Firefox experience",
"homepage_url": "https://github.com/He4eT/tabswitcher",
"manifest_version": 3,
"name": "Tabswitcher",
"permissions": [
"tabs",
"sessions"
"sessions",
"storage"
],
"version": "1.1.1"
}
"options_ui": {
"page": "options.html",
"open_in_tab": false
}
}

40
options.html Normal file
View file

@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: system-ui, sans-serif; padding: 20px; min-width: 300px; background: #222; color: #eee; }
h2 { margin-top: 0; font-size: 16px; }
.setting { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-size: 14px; }
input[type="text"] {
width: 100%;
padding: 8px;
border-radius: 4px;
border: 1px solid #444;
background: #333;
color: white;
font-family: monospace;
}
button {
padding: 8px 16px;
background: #0060df;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover { background: #003eaa; }
#status { margin-left: 10px; font-size: 12px; color: #4ade80; opacity: 0; transition: opacity 0.5s; }
</style>
</head>
<body>
<h2>Tabswitcher Settings</h2>
<div class="setting">
<label for="font-family">Custom Font Family</label>
<input type="text" id="font-family" placeholder="e.g. Iosevka, Consolas, Comic Sans MS">
</div>
<button id="save">Save Settings</button>
<span id="status">Saved!</span>
<script src="options.js"></script>
</body>
</html>

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);

View file

@ -1,5 +1,5 @@
html, body {
font-family: sans;
font-family: var(--user-font, system-ui, -apple-system, "Segoe UI", sans-serif);
margin: 0;
padding: 0;

View file

@ -1,3 +1,12 @@
// Load User Font Preference immediately
browser.storage.sync.get("userFont").then((result) => {
const fontStack = result.userFont
? `${result.userFont}, system-ui, sans-serif` // User choice + fallback
: `system-ui, -apple-system, "Segoe UI", sans-serif`; // Default fallback
document.documentElement.style.setProperty('--user-font', fontStack);
});
import * as Store from './modules/store.js'
import * as bridge from './modules/bridge.js'
import * as dom from './modules/dom.js'