Steam Spend Tracker

Efficiently read all bills to calculate spending, refunds, and net expenses

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 or Violentmonkey 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
hee1310
Daily installs
0
Total installs
9
Ratings
0 0 0
Version
1.1.0
Created
2026-06-19
Updated
2026-06-26
Size
6.8 KB
License
GPL3
Applies to

Steam消费总额查看

1. 一键全量加载账单统计

进入 消费记录页面 后,自动渲染「查看消费统计」按钮,点击后自动完成以下流程:

  1. 自动循环点击「加载更多」分页按钮,拉取全部历史账单(最大限制120页,防止无限加载卡死)
  2. 智能区分消费订单退款订单,自动提取页面货币符号(自动适配各区服货币)
  3. 三项核心金额自动计算:
    • 总支出(所有下单原始金额,包含后续退款的订单)
    • 累计退款总额(所有退款订单合计)
    • 实际净支出 = 总支出 - 累计退款(真实花出去的钱)

2. 本地缓存机制

  • 统计结果本地缓存5分钟(300000毫秒),重复点击按钮不会重复加载分页,提升使用速度、减少页面卡顿
  • 缓存过期后再次点击,会重新拉取完整账单重新计算

3. 多语言自动适配

脚本自动读取Steam页面语言,弹窗文字、按钮、导航文字自动切换,暂时支持:

  • 简体中文(zh-CN)
  • 繁体中文(zh-TW)
  • English

4. 防卡死容错设计

  1. 分页加载间隔450ms,给Steam接口渲染数据预留缓冲时间
  2. 页面DOM定时巡检(800ms轮询)+ 节点变化监听(MutationObserver)双重保障按钮正常渲染
  3. 30秒后自动关闭定时巡检,减少浏览器性能占用
  4. 捕获页面加载异常,弹出错误提示引导刷新重试
  5. 重复点击统计按钮会做加载锁拦截,避免并发重复请求

参数配置说明(可自行修改代码cfg对象调整)

const cfg = {
    maxPage: 120,    // 最大加载账单页数,账单极多可上调,建议不超200
    wait: 450,       // 每页加载等待毫秒,网络差可增大至800~1000
    cacheTime: 300000, // 统计缓存有效期(ms),300000=5分钟
    domTick: 800     // DOM定时检测间隔,无需修改
};