|
|
本帖最后由 1888490 于 2026-12-2 21:27 编辑
RT,国外论坛上有人发了这个问题的解决办法,这是源于HB网站改版后的遗留问题,新版网页通过 React 订阅对象里的 isSkippable 布尔值来决定是否渲染“跳过”按钮。由于改版后的前端逻辑或接口返回异常,这个字段在很多符合跳过条件的账号上错误地变成了 false,导致按钮组件直接不显示。
解决办法需要改前端,我把它的代码AI成了脚本,群友测试了一下是能把跳过按钮显示出来的
不过本人没买年包测试不了,求有年包想跳过的坛友试试。
正常点skip按钮后会显示确认信息:
篡改猴脚本:
- // ==UserScript==
- // @name Humble Choice Show Skip Button
- // @namespace http://tampermonkey.net/
- // @version 1.2
- // @description Fix missing Skip a Month button on Humble Bundle Choice settings page
- // @match https://www.humblebundle.com/user/settings*
- // @grant none
- // @run-at document-idle
- // ==/UserScript==
- (function () {
- 'use strict';
- function showSkipButton() {
- const all = document.querySelectorAll('*');
- let fiber = null;
- for (const el of all) {
- const k = Object.keys(el).find(key => key.startsWith('__reactFiber'));
- if (k) {
- fiber = el[k];
- break;
- }
- }
- if (!fiber) return false;
- while (fiber.return) {
- fiber = fiber.return;
- }
- const stack = [fiber];
- while (stack.length) {
- const f = stack.pop();
- const v = f.memoizedProps && f.memoizedProps.value;
- if (v && typeof v === 'object' && typeof v.setSubscription === 'function' && v.subscription) {
- if (v.subscription.isSkippable === true) {
- return true;
- }
- v.setSubscription(Object.assign({}, v.subscription, { isSkippable: true }));
- console.log('[Humble Skip] Skip button unlocked');
- return true;
- }
- if (f.sibling) stack.push(f.sibling);
- if (f.child) stack.push(f.child);
- }
- return false;
- }
- let attempts = 0;
- const timer = setInterval(function () {
- attempts++;
- if (showSkipButton() || attempts >= 15) {
- clearInterval(timer);
- }
- }, 1000);
- window.addEventListener('hashchange', function () {
- setTimeout(showSkipButton, 500);
- });
- const btn = document.createElement('button');
- btn.innerText = 'Show Skip Button';
- Object.assign(btn.style, {
- position: 'fixed',
- bottom: '20px',
- right: '20px',
- zIndex: '99999',
- padding: '8px 14px',
- backgroundColor: '#cb272c',
- color: '#ffffff',
- border: 'none',
- borderRadius: '6px',
- cursor: 'pointer',
- fontSize: '13px',
- boxShadow: '0 2px 8px rgba(0,0,0,0.25)'
- });
- btn.addEventListener('click', function () {
- const ok = showSkipButton();
- btn.innerText = ok ? 'Done' : 'Not Found';
- btn.style.backgroundColor = ok ? '#16a34a' : '#6b7280';
- setTimeout(function () {
- btn.innerText = 'Show Skip Button';
- btn.style.backgroundColor = '#cb272c';
- }, 2000);
- });
- document.body.appendChild(btn);
- })();
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
×
1、转载或引用本网站内容,必须注明本文网址:https://keylol.com/t1057042-1-1。如发文者注明禁止转载,则请勿转载
2、对于不当转载或引用本网站内容而引起的民事纷争、行政处理或其他损失,本网站不承担责任
3、对不遵守本声明或其他违法、恶意使用本网站内容者,本网站保留追究其法律责任的权利
4、所有帖子仅代表作者本人意见,不代表本社区立场
|