Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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 changes: 40 additions & 0 deletions options.html
Original file line number Diff line number Diff line change
@@ -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 changes: 27 additions & 0 deletions options.js
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 1 addition & 1 deletion pages/css/common.css
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
9 changes: 9 additions & 0 deletions pages/search/search.js
Original file line number Diff line number Diff line change
@@ -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'
Expand Down