Initial release v1.2.0 — Hellion NewTab Browser Extension
Persoenlicher Bookmark-Dashboard als Browser-Extension. 8 Themes, Drag & Drop, Sticky Notes, JSON Export/Import. Chrome, Edge, Brave, Opera, Vivaldi (MV3) + Firefox (MV2). Includes GitHub Actions for security scanning, code quality validation, and automated release packaging.
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
/* =============================================
|
||||
HELLION NEWTAB — state.js
|
||||
Globaler State, Default-Werte, Hilfsfunktionen
|
||||
============================================= */
|
||||
|
||||
let boards = [];
|
||||
|
||||
let settings = {
|
||||
compact: false,
|
||||
shortenTitles: false,
|
||||
newTab: true,
|
||||
showDesc: false,
|
||||
hideExtra: false,
|
||||
visibleCount: 10,
|
||||
bgUrl: '',
|
||||
theme: 'astronaut',
|
||||
showSearch: true,
|
||||
searchEngine: 'google'
|
||||
};
|
||||
|
||||
function uid() {
|
||||
return Math.random().toString(36).slice(2, 10) + Date.now().toString(36);
|
||||
}
|
||||
|
||||
function escHtml(str) {
|
||||
return String(str)
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"');
|
||||
}
|
||||
|
||||
function getFaviconUrl(url) {
|
||||
try {
|
||||
const u = new URL(url);
|
||||
return `https://www.google.com/s2/favicons?domain=${u.hostname}&sz=16`;
|
||||
} catch {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function getDefaultBoards() {
|
||||
return [
|
||||
{
|
||||
id: uid(),
|
||||
title: 'Getting Started',
|
||||
bookmarks: [
|
||||
{ id: uid(), title: 'GitHub', url: 'https://github.com', desc: '' },
|
||||
{ id: uid(), title: 'MDN Web Docs', url: 'https://developer.mozilla.org', desc: '' },
|
||||
{ id: uid(), title: 'Next.js Docs', url: 'https://nextjs.org/docs', desc: '' },
|
||||
],
|
||||
blurred: false
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
async function saveBoards() {
|
||||
await Store.set('boards', boards);
|
||||
}
|
||||
|
||||
async function saveSettings() {
|
||||
await Store.set('settings', settings);
|
||||
}
|
||||
Reference in New Issue
Block a user