Mouse Plus

Ctrl + right-click mouse gestures for basic webpage navigation.

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!)

Autor
maya1900
Instalări zilnice
0
Total instalări
1
Rating-uri
0 0 0
Versiune
1.0.2
Creat
12-05-2026
Actualizat
12-05-2026
Size
13,7 KB
Compatibilitate
Compatibil cu Firefox Compatibil cu Chrome Compatibil cu Edge
Licență
MIT
Se aplică pe
Toate site-urile

# Mouse Plus

Mouse Plus 是一个精简的鼠标手势 userscript,用于网页后退、前进、刷新、停止加载、滚动和重新打开最近页面等基础操作。

脚本不请求远程接口,不加载外链资源,只使用用户脚本存储记录最近卸载的网页,用于“打开刚才关闭的网页”。

## 安装

1. 安装 Tampermonkey、Violentmonkey 或兼容的用户脚本管理器。
2. 打开安装地址:
3. 在用户脚本管理器中确认安装。

也可以直接打开仓库里的 `mouse-plus.user.js` 手动安装。

## 发布到 Greasy Fork

1. 登录 Greasy Fork。
2. 打开 。
3. 选择从 URL 导入或同步,填写:

```text
https://raw.githubusercontent.com/maya1900/mouse-plus/main/mouse-plus.user.js
```

4. 确认脚本类型为用户脚本,保存发布。

Greasy Fork 会读取脚本元信息,并把安装和更新地址改写为 Greasy Fork 自己的地址。

## 使用

- 普通右键不触发手势,浏览器原生右键菜单保持不变。
- 按住 `Ctrl + 右键` 会进入手势候选状态,并屏蔽这次右键菜单。
- 移动超过 10px 后激活手势,页面会显示鼠标轨迹和文字提示。
- 一旦手势激活,本轮手势不再依赖 `Ctrl` 是否继续按住。
- 松开右键后执行已识别的手势动作。

## 手势

| 手势 | 操作 |
| --- | --- |
| ← | 后退 |
| → | 前进 |
| ↑ | 回到顶部 |
| ↓ | 滚到底部 |
| ↑↓ | 刷新 |
| ↓↑ | 硬性重新加载 |
| ↑← | 清空缓存刷新 |
| ←↓→ | 打开刚才关闭的网页 |
| ←→ | 重新打开当前页 |
| →← | 停止加载 |
| ↓→ | 关闭当前标签页 |
| ↓← | 横向滚动到左侧 |
| →↓ | 向下翻页 |
| →↑ | 向上翻页 |

## 行为说明

- 无法识别的手势会提示“无效手势”,不会执行任何操作。
- 在输入框、文本域、下拉框和可编辑区域中不会启动手势,避免影响正常编辑。
- 默认只在顶层页面运行,不进入 iframe,避免同一页面里重复触发。
- “清空缓存刷新”会尝试删除当前页面可访问的 Cache API 缓存,并加时间戳参数重新加载;浏览器 HTTP 缓存不一定允许 userscript 完整清空。
- “打开刚才关闭的网页”使用脚本自己记录的最近卸载页面,不读取浏览器原生最近关闭标签列表。
- 关闭标签页依赖浏览器权限限制,普通用户手动打开的标签页通常会被浏览器阻止关闭,脚本会给出失败提示。

## 调整手势

在 `mouse-plus.user.js` 的 `GESTURES` 中增删映射即可:

```js
['L', { label: '后退', action: () => window.history.back() }]
```

方向字母含义:

| 字母 | 方向 |
| --- | --- |
| L | 左 |
| R | 右 |
| U | 上 |
| D | 下 |

## 权限

脚本使用以下用户脚本权限:

- `GM_getValue` / `GM_setValue`:记录最近卸载的网页。
- `GM_openInTab`:新标签页打开刚才关闭的网页。

脚本不使用跨域请求权限。

## 许可证

MIT