CleanSlateTab
No description available
Install / Use
/learn @4everWZ/CleanSlateTabREADME
new_tab_extension (Modular Refactor)
This Chrome extension overrides the New Tab page and provides:
- Search box with selectable engines
- Wallpaper (local + remote sources)
- Shortcuts grid with edit mode, icon editor, drag & drop
- Settings sidebar (persisted via
chrome.storage.local)
Project layout
Top-level files:
newtab.html: New Tab UI markup. Loads scripts in this order:i18n.js(global i18n compatibility)script.js(type="module"entry)
script.js: Thin entry that importssrc/app.jsi18n.js: IIFE-style script that still exports compatibility globals (t,setLanguage,currentLanguage)src/style.css: Styling + app-ready gating to prevent FOUCmanifest.json: Extension configuration
Module code (ES Modules) lives under src/:
src/app.js: App bootstrap; buildsctx, loads storage, applies settings, initializes featuressrc/background.js: Service Worker for WebDAV proxying (CORS bypass) and logicsrc/state.js: Central state model and helperssrc/dom.js: DOM element lookup + DOM-related helperssrc/constants.js: Shared constants
Features (UI behavior by area):
src/features/search.js: Search engine + submit behaviorsrc/features/settingsPanel.js: Settings sidebar UI + persistencesrc/features/shortcuts.js: Shortcuts grid, edit mode, icon editor, DnD, paginationsrc/features/sidebar.js: Sidebar toggling + layout wiringsrc/features/wallpaper.js: Wallpaper source handling + refreshsrc/features/sync.js: WebDAV synchronization logic (V2 with binary support)
Utilities:
src/utils/storage.js: Promise wrappers forchrome.storage.*src/utils/db.js: IndexedDB wrapper for large asset storage (Wallpapers/Icons)src/utils/images.js: Image formatting, compression, and analysis helperssrc/utils/favicon.js: Favicon URL generatorssrc/utils/webdav.js: WebDAV Client implementation
UI glue:
src/ui/settingsApply.js: Apply persisted settings to CSS vars / DOM
Key design decisions
- Stable entrypoints:
newtab.htmlcontinues to loadscript.js, so file moves don’t require HTML changes. - Compatibility i18n:
i18n.jsis isolated internally, but keepsglobalThis.t/setLanguagefor older callers. - FOUC prevention: UI is hidden until storage-backed settings have been applied (via
body.app-ready). - Icon resilience: When choosing online icons, icons are cached as
data:URLs to survive offline reloads.
Development
Load unpacked
- Open
chrome://extensions/ - Enable Developer mode
- Click Load unpacked
- Select this folder
WebDAV Sync Usage
The extension supports syncing settings and assets (wallpapers, shortcut icons) via WebDAV.
- Open Settings -> Data Sync (WebDAV).
- Enter your WebDAV Server URL, Username, and Password.
- Click Check Connection to verify.
- Use the buttons to sync:
- Upload: Overwrites remote data with your local data.
- Download: Overwrites local data with remote data.
- Merge: Downloads remote data and merges it with local data (Remote settings overwrite local; Shortcuts are combined by URL).
Testing
See TESTING.md.
Notes
- This repo uses ES Modules in the New Tab page context.
- Persisted data is stored in
chrome.storage.local. - Binary assets (Wallpapers/Icons) are stored in IndexedDB.
Support
If you like this extension, you can buy me a coffee!
| WeChat Pay | WeChat | | :---: | :---: | | <img src="images/WeChat_1.jpg" width="200"> | <img src="images/WeChat.png" width="200"> |
Feel free to sponsor and connect with me!
Related Skills
node-connect
343.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
92.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
343.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
343.3kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
