Form Save&ReFill / 通用表单助手 (菜单控制版)

在任何网页手动保存/恢复表单数据。通过 Tampermonkey 菜单操作,支持导出/导入文件。

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

Author
LantoZheng
Daily installs
0
Total installs
0
Ratings
0 0 0
Version
3.1
Created
2025-12-11
Updated
2025-12-11
Size
8.57 KB
License
MIT
Applies to
All sites

📝 Universal Form Saver (Menu Controlled) / 通用表单助手 (菜单控制版)

📖 English Description

Universal Form Saver is a powerful yet unobtrusive userscript designed to save your progress on web forms. Whether you are filling out a long job application, a government form, or a complex survey, this script ensures you never lose your data due to accidental refreshes, browser crashes, or session timeouts.

Unlike other scripts that inject clutter into the page, this version is clean and invisible. It is controlled entirely through the Tampermonkey/Violentmonkey extension menu, keeping the original webpage UI intact.

✨ Key Features

  • 💾 Local Storage Save: Instantly save all form data to your browser's local cache with one click.
  • ♻️ Smart Restore: Intelligently refills inputs, textareas, radio buttons, and checkboxes.
  • ⚛️ Modern Framework Support: Triggers input, change, and blur events during restoration. This ensures compatibility with modern reactive websites (React, Vue, Angular) that validate data in real-time.
  • 📂 JSON Import/Export: Export your form data as a .json file for backup or to migrate data to another computer.
  • 📎 File Input Reminder: Due to browser security, scripts cannot restore actual files. However, this script remembers the filename you uploaded and highlights the file input box in red to remind you to re-upload it.
  • 🛡️ Privacy Focused: All data is stored locally on your device (LocalStorage or JSON file). No data is sent to any server.

🚀 How to Use

  1. Install the script.
  2. Go to any webpage with a form.
  3. Fill out the form.
  4. To Save: Click the Tampermonkey extension icon in your browser toolbar and select "💾 Save current form".
  5. To Restore: Refresh the page or return later, open the Tampermonkey menu, and select "♻️ Restore form data".
  6. To Export: Select "⬇️ Export to JSON" from the menu to download a backup file.

📖 中文说明

通用表单助手 是一款强大且极简的油猴脚本,专为防止表单数据丢失而设计。无论您是在填写冗长的求职申请、政府表格还是复杂的问卷,它都能帮您应对网页崩溃、误触刷新或会话超时(Session Timeout)带来的灾难。

与在页面上添加悬浮球的脚本不同,本版本完全隐形,所有操作均通过 油猴扩展的菜单 完成,不会破坏网页原本的美观和布局。

✨ 主要功能

  • 💾 浏览器缓存保存: 一键将当前表单的所有内容保存到浏览器的本地存储(LocalStorage)中。
  • ♻️ 智能恢复: 自动回填输入框、文本域、单选框和复选框。
  • ⚛️ 兼容现代框架: 在恢复数据时会自动触发 input, change, blur 事件。这意味着它可以完美支持 React、Vue、Angular 等现代动态网页,确保存储的数据能被网页逻辑正确识别。
  • 📂 JSON 导入/导出: 支持将表单数据导出为 .json 文件。您可以将其作为备份,或发送到另一台电脑上导入使用。
  • 📎 文件上传提醒: 受限于浏览器安全策略,脚本无法直接恢复文件内容。但它会记住您上次上传的文件名,并在恢复时用红色虚线框高亮显示文件上传控件,并在鼠标悬停时提示原文件名,防止您漏传附件。
  • 🛡️ 隐私安全: 所有数据仅保存在您的本地设备上,绝不会上传到任何云端服务器。

🚀 使用方法

  1. 安装 本脚本。
  2. 打开任何包含表单的网页。
  3. 填写表单内容。
  4. 保存: 点击浏览器右上角的油猴(Tampermonkey)图标,在弹出的菜单中点击 "💾 保存当前表单"
  5. 恢复: 刷新页面或重新打开页面后,再次点击油猴图标,选择 "♻️ 恢复表单数据"
  6. 导出/导入: 通过菜单中的 "⬇️ 导出""📂 导入" 按钮,可以生成或读取 JSON 备份文件。

⚠️ Notes / 注意事项

  • File Inputs / 文件上传: The script cannot restore the actual file content (this is a browser security limitation). It will only highlight the input and show the previous filename as a tooltip.
    • 脚本无法恢复具体的文件内容(这是浏览器的安全限制)。它只会高亮显示该上传框,并提示您上次上传的文件名,请务必手动重新上传。
  • Scope / 作用域: Saved data is bound to the domain and path (e.g., example.com/apply). Query parameters (e.g., ?session=123) are ignored to ensure data persists even if the URL parameters change slightly.
    • 保存的数据绑定在当前域名和路径下。脚本会忽略 URL 中的查询参数(如 ?id=1),以确保即使链接参数发生变化,数据依然可以恢复。