mirror of
https://github.com/He4eT/tabswitcher.git
synced 2026-05-05 01:17:23 +00:00
Merge aee213e96d into 5bc492d866
This commit is contained in:
commit
09c17d478c
5 changed files with 92 additions and 9 deletions
|
|
@ -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": {
|
"action": {
|
||||||
"default_title": "Tabswitcher"
|
"default_title": "Tabswitcher"
|
||||||
},
|
},
|
||||||
"background": {
|
"background": {
|
||||||
"scripts": ["background.js"]
|
"scripts": [
|
||||||
|
"background.js"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"browser_specific_settings": {
|
"browser_specific_settings": {
|
||||||
"gecko": {
|
"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": [
|
"permissions": [
|
||||||
"tabs",
|
"tabs",
|
||||||
"sessions"
|
"sessions",
|
||||||
|
"storage"
|
||||||
],
|
],
|
||||||
"version": "1.1.1"
|
"options_ui": {
|
||||||
|
"page": "options.html",
|
||||||
|
"open_in_tab": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
40
options.html
Normal file
40
options.html
Normal 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
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);
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
html, body {
|
html, body {
|
||||||
font-family: sans;
|
font-family: var(--user-font, system-ui, -apple-system, "Segoe UI", sans-serif);
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 Store from './modules/store.js'
|
||||||
import * as bridge from './modules/bridge.js'
|
import * as bridge from './modules/bridge.js'
|
||||||
import * as dom from './modules/dom.js'
|
import * as dom from './modules/dom.js'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue