rush4award

🔥功能介绍🔥:🎉 1、支持B站所有激励计划,是否成功取决于b站接口是否更新,与游戏版本无关;🎉 2、打开对应一个兑换码页面自动运行;

目前為 2025-04-20 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        rush4award
// @namespace   vurses
// @license     Mit
// @match       https://www.bilibili.com/blackboard/new-award-exchange.html?task_id=*
// @version     3.0.0
// @author      layenh
// @icon        https://i0.hdslb.com/bfs/activity-plat/static/b9vgSxGaAg.png
// @description
// @run-at      document-start
// @grant       none
// @description 🔥功能介绍🔥:🎉 1、支持B站所有激励计划,是否成功取决于b站接口是否更新,与游戏版本无关;🎉 2、打开对应一个兑换码页面自动运行;
// ==/UserScript==
const Time = 1000;

// 拦截window.webpackJsonp 的 push,劫持其模块
window.webpackJsonp = window.webpackJsonp || [];
const originalPush = window.webpackJsonp.push;

window.webpackJsonp.push = function (item) {
  if (Array.isArray(item) && "2b0e" in item[1]) {
    let temp = item[1]["2b0e"].toString();
    // 暴露vue实例
    temp.indexOf("t._watchers=[];var e=t.$options;");
    temp = temp.replace(
      `t._watchers=[];var e=t.$options;`,
      (res) => res + "window._rewardEntity = e;"
    );
    temp = eval("(" + temp + ")");
    item[1]["2b0e"] = temp;
  }
  return originalPush.call(this, item);
};
document.addEventListener(
  "visibilitychange",
  function (event) {
    event.stopImmediatePropagation(); // 阻断b站设置的visibilitychange监听器
  },
  true
);
(function () {
  const timer = setInterval(() => {
    // 获取到cdKey取消执行
    if (window._rewardEntity?.parent?.cdKey) {
      clearInterval(timer);
    }
    // b站程序猿的typo:handle=>handel
    window._rewardEntity.parent.handelReceive();
    console.log(window._rewardEntity.parent.receiveBtnText);
    // essentialKey:receiveBtnText,gaia_vtoken,cdKey,date
    // todo:倒计时
  }, Time);
})();