Website Data Cleaner

One-click clear current website data(localStorage/Cookie/Database etc.)

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

Autor
Chiam Zhang
Denně instalací
1
Celkem instalací
3
Hodnocení
0 0 0
Verze
1.3.0
Vytvořeno
20. 11. 2025
Aktualizováno
20. 11. 2025
Size
17,7 KB
Licence
MIT
Spustit na
všech stránkách

# Website Data Cleaner

![License](https://img.shields.io/badge/license-MIT-blue.svg)
![Version](https://img.shields.io/badge/version-1.2.0-green.svg)
![Compatible Browsers](https://img.shields.io/badge/browsers-Chrome%20%7C%20Firefox%20%7C%20Edge%20%7C%20Safari-orange.svg)

## Project Introduction
A Tampermonkey script that enables one-click cleaning of various stored data for the current website via the Tampermonkey menu. It supports precise categorized cleaning to protect user privacy and resolve issues caused by website data caching. The script automatically detects the system/browser language and displays an English or Chinese interface accordingly.

## Core Features
### 🌐 Supported Data Types
- `localStorage`: Persistent local storage (data saved permanently by the website)
- `sessionStorage`: Session storage (temporary data for the current tab)
- `Cookies`: Website cookies (including login status, preferences, etc.)
- `IndexedDB`: Browser database (offline data storage for websites)
- `Web SQL`: Legacy web database (compatible with older websites)

### 🎯 Key Features
1. **Menu-driven Operation**: No floating buttons on the webpage; triggered via the Tampermonkey menu without interfering with normal webpage usage
2. **Categorized Cleaning**: 4 cleaning modes available to choose on demand, preventing misoperations
3. **Safety Prompts**: Confirmation popups before each operation to clearly inform of cleaning consequences
4. **Multi-dimensional Feedback**: Browser notifications + on-page prompts + console logs for clear operation results
5. **High Compatibility**: Supports major browsers (Chrome/Firefox/Edge/Safari) with optimized cross-browser data cleaning logic
6. **Intelligent Error Handling**: Friendly prompts when IndexedDB is occupied, without affecting the overall process
7. **Auto Language Switching**: Automatically displays English or Chinese interface based on system/browser language settings

## Installation
### Prerequisites
1. Install the Tampermonkey extension:
- Chrome/Firefox/Edge: [Tampermonkey Official Download](https://www.tampermonkey.net/)
- Safari: Search for "Tampermonkey" in the App Store and install

### Script Installation
1. Open the Tampermonkey extension and click "Create a new script"
2. Delete the default template code and paste the [full script code](https://github.com/ChiamZhang/WebsiteDataCleaner/script.user.js)
3. Click "File" → "Save" (Shortcut: Ctrl+S / Cmd+S)
4. Refresh any webpage to activate the script automatically

## Usage Guide
1. Visit the website for which you want to clear data
2. Click the Tampermonkey extension icon in the browser's top right corner
3. Select the corresponding cleaning function from the script menu:

| Menu Option | Function Description |
|-------------|----------------------|
| 🗑️ Clear All Data of Current Website | Clears all supported data types (recommended first choice) |
| 📦 Clear Only localStorage + SessionStorage | Clears only basic storage data without affecting login status |
| 🍪 Clear Only Current Website Cookies | Clears only cookies (login status will be lost) |
| 🗄️ Clear Only IndexedDB + Web SQL | Clears only database data, suitable for resolving offline cache issues |
| 💬 Feedback & Suggestions | Opens the feedback page to submit issues or feature suggestions |

4. Click "OK" in the confirmation popup to start cleaning
5. After cleaning is complete, refresh the page as prompted for the changes to take effect

## Notes
1. **Login Status Impact**: Clearing cookies will invalidate website login status, requiring re-login
2. **Irreversible Operation**: All cleaning operations are permanent; please confirm before execution
3. **IndexedDB Limitation**: If other tabs are using the website's IndexedDB, cleaning may fail. Close other tabs and try again
4. **Web SQL Compatibility**: Some modern browsers have phased out Web SQL, and cleaning results may vary by browser
5. **Browser Cache**: This script does not clear browser file cache (e.g., images, JS/CSS files). To clear these, use your browser's settings
6. **Language Auto-detection**: The interface automatically switches to English for non-Chinese systems/browsers, and Chinese for Chinese-speaking environments (supports zh-CN, zh-TW, zh-HK, etc.)

## FAQ
### Q1: Website still has issues after cleaning?
A1: Try "Clear All Data of Current Website" and force refresh the page (Ctrl+F5 / Cmd+Shift+R). If issues persist, restart the browser and try again.

### Q2: Tampermonkey menu does not appear?
A2: 1. Check if the script is enabled; 2. Confirm the webpage URL matches the script's match rule (`*://*/*` supports all HTTP/HTTPS websites); 3. Refresh the page or restart the browser; 4. Reinstall the script.

### Q3: Can I customize cleaning options?
A3: Yes! You can modify the `menuAll` array in the script to add/remove menu options, or adjust the cleaning functions to meet custom needs.

### Q4: How to force a specific language (English/Chinese)?
A4: Manually modify the `currentLang` variable in the script: set `currentLang = 'en'` for English or `currentLang = 'zh'` for Chinese.

## Feedback & Contribution
- If you encounter script failures, cleaning errors, or other issues, submit feedback via the "Feedback & Suggestions" menu option
- Fork this project and submit Pull Requests to contribute code
- Propose feature suggestions in the Issues section

## License
This project is open-source under the MIT License. You are free to use, modify, and distribute it, provided that the original author's copyright notice is retained.

---
© 2025 Doubao Programming Assistant
Last Updated: 2025-11-21