|
1 | | -# SesWi — Advanced Session Manager (Chrome Extension) |
| 1 | +# SesWi — Session Manager |
2 | 2 |
|
3 | | -SesWi is a Chrome extension (Manifest V3) for saving and restoring login sessions per domain. It captures cookies along with `localStorage` and `sessionStorage` snapshots, lets you list and group sessions across domains, backup/restore sessions (plain JSON or password-encrypted OWI), and clean current tab data when needed. |
| 3 | +Chrome extension for saving and restoring login sessions. Captures cookies, localStorage, and sessionStorage per domain. |
4 | 4 |
|
5 | | -## What's New in v2.2 |
6 | | - |
7 | | -### 🧹 Clean Current Tab Enhancements |
8 | | -- **Data preview** — See cookies, localStorage, sessionStorage, and history items before clearing |
9 | | -- **Expandable sections** — Click to expand each data type and view details |
10 | | -- **Cookie expiration status** — Visual indicators showing if cookies are Session, Valid, Warning, or Expired |
11 | | -- **History preview** — View page titles, URLs, and relative visit times |
12 | | -- **History count detection** — Shows actual number of history entries for current domain |
13 | | - |
14 | | -### 🔒 Bug Fixes & Security |
15 | | -- **Fixed CSP violations** — Removed all inline event handlers for better security compliance |
16 | | -- **Fixed history clearing** — Now uses `chrome.history.deleteUrl` API properly |
17 | | -- **Fixed cookie domain matching** — Exact domain matching prevents accidental cross-domain deletion |
18 | | -- **Improved cache clearing** — Added fallback for browsers that don't support origin-based cache clearing |
19 | | - |
20 | | -### 🛠️ Code Cleanup |
21 | | -- Removed all TODO/FIXME comments (implementations complete) |
22 | | -- Cleaner codebase with proper JS event handlers |
23 | | - |
24 | | ---- |
25 | | - |
26 | | -## What's New in v2.1 |
27 | | - |
28 | | -### 🔄 Complete Architecture Rebuild |
29 | | -- **43% fewer files** — Consolidated from 21 files to 12 files |
30 | | -- **Modular structure** — Clean separation: `core/` for Chrome APIs, `ui/` for interface |
31 | | -- **Single CSS file** — All styles consolidated into `main.css` with Tailwind utilities |
32 | | -- **Vite build system** — Modern bundler for faster development and optimized builds |
33 | | - |
34 | | -### ✨ New Features |
35 | | -- **Selective storage save** — Choose to include/exclude localStorage and sessionStorage when saving |
36 | | -- **Clear after save** — Option to clear tab data immediately after saving a session |
37 | | -- **Enhanced Clean Tab modal** — Selectively clear cookies, localStorage, sessionStorage, history, or cache |
38 | | -- **Improved favicon caching** — Faster icon loading with persistent cache |
39 | | -- **Better sensitive domain detection** — Expanded warnings for Google/Microsoft ecosystems |
40 | | - |
41 | | -### 🛠️ Improvements |
42 | | -- **Faster popup load** — Reduced file count and optimized imports |
43 | | -- **Better error handling** — Consistent Response pattern across all modules |
44 | | -- **Improved pagination** — Smoother navigation in session lists |
45 | | -- **Enhanced UI feedback** — Better visual states for actions and selections |
46 | | - |
47 | | -### 🔧 Technical Changes |
48 | | -- Migrated to ES modules throughout |
49 | | -- Removed redundant abstraction layers |
50 | | -- Unified utility functions in `utils.js` |
51 | | -- Backward compatible — existing sessions will work without migration |
| 5 | +## Features |
52 | 6 |
|
53 | | -## Alpha version |
54 | | -- https://github.com/risunCode/SesWi-Session-Manager/tree/Alpha |
| 7 | +- **Save & Restore** — Save complete login sessions and restore them later |
| 8 | +- **Smart Expiration** — Tracks cookie expiration based on longest-lasting cookie *(experimental, may be inaccurate)* |
| 9 | +- **Domain Groups** — Auto-groups sessions by domain for easy management |
| 10 | +- **Backup/Export** — JSON (plain) or OWI (AES-256 encrypted) formats |
| 11 | +- **Batch Operations** — Bulk backup, delete expired, or clean by domain |
| 12 | +- **Clean Tab** — Selectively clear cookies, storage, history, and cache |
55 | 13 |
|
56 | | -## Features |
| 14 | +## Showcase |
57 | 15 |
|
58 | | -- **Save sessions per domain**: cookies + `localStorage` + `sessionStorage` |
59 | | -- **Restore cookies** only when on the same domain (prevents cross-domain conflicts) |
60 | | -- **Three tabs**: `Current` (active domain), `Groups` (all domains), `Manage` (backup/restore, bulk actions, clean data) |
61 | | -- **Backup/Restore**: export all sessions to JSON (plain) or OWI (AES-CCM 256-bit via SJCL), restore with password verification for OWI |
62 | | -- **Clean Current Tab**: selectively remove cookies, localStorage, sessionStorage, history, and cache for the active domain |
63 | | -- **Cached favicons** per domain for a faster, informative UI |
| 16 | +| Current Tab | Groups Tab | Manage Tab | |
| 17 | +|:-----------:|:----------:|:----------:| |
| 18 | +| <img width="280" alt="Current Tab" src="https://github.com/user-attachments/assets/82415046-8903-4e6b-bd63-ef8a35a7eac3" /> | <img width="280" alt="Groups Tab" src="https://github.com/user-attachments/assets/648ba543-bb21-4159-a436-7114e65ef0d7" /> | <img width="280" alt="Manage Tab" src="https://github.com/user-attachments/assets/900dff33-7de2-4a6d-b4ff-5f9b5e82de90" /> | |
64 | 19 |
|
65 | | -## Installation (Load Unpacked) |
| 20 | +## Installation |
66 | 21 |
|
67 | | -1. Clone or download this repository |
68 | | -2. Run `npm install` and `npm run build` to generate the `dist` folder |
69 | | -3. Open Chrome → `chrome://extensions` |
70 | | -4. Enable `Developer mode` (top right) |
71 | | -5. Click `Load unpacked` and select the `dist` folder |
72 | | -6. Pin the extension icon if needed |
| 22 | +1. Clone/download this repository |
| 23 | +2. Run `npm install && npm run build` |
| 24 | +3. Open `chrome://extensions` → Enable Developer mode |
| 25 | +4. Click "Load unpacked" → Select the `dist` folder |
73 | 26 |
|
74 | 27 | ## Usage |
75 | 28 |
|
76 | | -- Click the extension icon to open the popup |
77 | | -- Header displays the current domain and `Add Session` button |
78 | | -- **Current tab**: shows sessions for the active domain; click a card to open Session Actions (Restore, Edit, Replace, Delete, Backup JSON/OWI) |
79 | | -- **Groups tab**: grouped sessions across all domains with expand/collapse and pagination |
80 | | -- **Manage tab**: |
81 | | - - `Backup All Sessions`: export to JSON (unencrypted) or OWI (encrypted) |
82 | | - - `Restore Sessions`: import from `.json` or `.owi` file with password verification |
83 | | - - `Group Manage`: select domains for bulk backup or delete |
84 | | - - `Clean Current Tab`: selectively clear cookies, localStorage, sessionStorage, history, and cache |
85 | | - |
86 | | -> **Note**: Session restore is restricted to the same domain as the current tab to prevent cross-domain cookie conflicts. |
| 29 | +- **Current tab** — Sessions for active domain |
| 30 | +- **Groups tab** — All sessions grouped by domain |
| 31 | +- **Manage tab** — Backup, restore, clean data, delete expired |
87 | 32 |
|
88 | 33 | ## Permissions |
89 | 34 |
|
90 | | -Declared in `manifest.json`: |
91 | | - |
92 | 35 | | Permission | Purpose | |
93 | 36 | |------------|---------| |
94 | | -| `tabs` | Read active tab, reload after restore/clean, fetch favicons | |
95 | | -| `cookies` | Read, delete, and set cookies per domain | |
96 | | -| `storage` | Store sessions and icon cache in `chrome.storage.local` | |
97 | | -| `scripting` | Execute scripts to read/write `localStorage` and `sessionStorage` | |
98 | | -| `history` | Search and delete browsing history for current domain | |
99 | | -| `browsingData` | Clear cache (optional) | |
100 | | -| `favicon` | Access favicon API for domain icons | |
101 | | -| `host_permissions: <all_urls>` | Enable cookie operations across all domains | |
102 | | - |
103 | | - |
104 | | -## Security & Privacy |
105 | | - |
106 | | -- Sessions are stored locally in `chrome.storage.local` (unencrypted). Protect your device. |
107 | | -- OWI encrypted backups use [SJCL](https://github.com/bitwiseshiftleft/sjcl) with AES-CCM 256-bit. Passwords are never stored. |
108 | | -- Sensitive domains (Google, Microsoft ecosystems) use complex auth flows; saving/restoring may not always work. The UI displays a warning for these domains. |
| 37 | +| `cookies` | Read/write cookies | |
| 38 | +| `storage` | Store sessions locally | |
| 39 | +| `scripting` | Access localStorage/sessionStorage | |
| 40 | +| `tabs` | Get active tab info | |
| 41 | +| `history` | Clean browsing history | |
| 42 | +| `browsingData` | Clear cache | |
109 | 43 |
|
110 | 44 | ## Development |
111 | 45 |
|
112 | 46 | ```bash |
113 | | -# Install dependencies |
114 | 47 | npm install |
115 | | - |
116 | | -# Development build with watch |
117 | | -npm run dev |
118 | | - |
119 | | -# Production build |
120 | | -npm run build |
| 48 | +npm run dev # Development with watch |
| 49 | +npm run build # Production build |
121 | 50 | ``` |
122 | 51 |
|
123 | 52 | ## License |
124 | 53 |
|
125 | | -``` |
126 | | -MIT License |
127 | | -
|
128 | | -Copyright (c) 2025 risunCode |
129 | | -
|
130 | | -Permission is hereby granted, free of charge, to any person obtaining a copy |
131 | | -of this software and associated documentation files (the "Software"), to use, |
132 | | -copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
133 | | -derivative works of the Software, subject to the following conditions: |
134 | | -
|
135 | | -1. The Software may be used for commercial purposes as part of a larger system or service. |
136 | | -2. The Software itself may not be sold as a standalone product or bundled and sold directly. |
137 | | -3. The above copyright notice and this permission notice shall be included in all |
138 | | - copies or substantial portions of the Software. |
139 | | -
|
140 | | -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
141 | | -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
142 | | -PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE |
143 | | -FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
144 | | -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
145 | | -DEALINGS IN THE SOFTWARE. |
146 | | -``` |
| 54 | +MIT License - See LICENSE file for details. |
147 | 55 |
|
148 | 56 | ## Credits |
149 | 57 |
|
150 | | -- [SJCL](https://github.com/bitwiseshiftleft/sjcl) (Stanford Javascript Crypto Library) for encryption |
| 58 | +- [SJCL](https://github.com/bitwiseshiftleft/sjcl) for encryption |
| 59 | +- [Netscape Cookies Exporter](https://github.com/osiro/netscape-cookies-exporter) for Netscape format reference |
151 | 60 | - [FontAwesome](https://fontawesome.com/) for icons |
152 | 61 | - Built by [risunCode](https://github.com/risunCode) |
0 commit comments