Files
Surge/Surge-main/Scripts/ClearApprovalCartId.js
2026-04-02 21:02:16 +08:00

49 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Surge 脚本:清空 ApprovalCartId
* 功能1. 清空数据 2. 系统弹窗 3. 网页显示纯净结果
* 触发地址http://clear_list.com
*/
const key = "ApprovalCartId";
// 1. 执行清空
$persistentStore.write("", key);
// 2. 控制台日志
console.log("✅ 操作成功 - 已清空 ApprovalCartId");
// 3. 发送系统通知 (手机顶部依然会弹窗)
$notification.post("🗑️ 清单已清空", "操作成功", "ApprovalCartId 已重置为空对象");
// 4. 生成网页 HTML (去掉了提示文字)
const html = `
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Clear List</title>
<style>
body { font-family: -apple-system, sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background-color: #f4f4f4; }
.card { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); text-align: center; }
h1 { color: #28a745; margin: 0 0 10px; }
p { color: #555; margin: 0; }
</style>
</head>
<body>
<div class="card">
<h1>✅ 操作成功</h1>
<p>ApprovalCartId 已被清空</p>
</div>
</body>
</html>`;
// 5. 返回给浏览器
$done({
response: {
status: 200,
headers: { "Content-Type": "text/html;charset=utf-8" },
body: html
}
});