您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
aiueo
当前为
// ==UserScript== // @name Twitch Enhancer // @namespace https://greasyfork.org/ja/users/941284-ぐらんぴ // @version 2025-02-23 // @description aiueo // @author ぐらんぴ // @match https://www.twitch.tv/* // @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== // @license MIT // @run-at document-start // @grant none // ==/UserScript== const origFetch = window.fetch; window.fetch = async function(url, init) { let res = await origFetch(url, init); // Check for null body status codes if(res.status === 204 || res.status === 205) { return res; // Return the response as is for these status codes } let data; try{ // Check if the response is not empty before parsing const text = await res.text(); data = text ? JSON.parse(text) : {}; }catch(err){ console.log('Failed to parse JSON:', err); return res; } // console.log(url, data, data.length); try{ if(url.startsWith('https://edge.ads.twitch.tv/ads')){//Prime Pop-up data = ''; } if(url == 'https://gql.twitch.tv/gql#origin=twilight'){// twilight data.forEach(i =>{ // login if(i.extensions.operationName == 'CoreActionsCurrentUser'){ // i.data.currentUser.roles.isStaff = true } if(i.extensions.operationName == 'FrontPageNew_User'){// followedGames // i.data.currentUser.roles.isStaff = true } }); } }catch(err){ console.log('err modifying data:', err); } return new Response(JSON.stringify(data), { headers: res.headers, status: res.status, statusText: res.statusText, }); }; const origAppendChild = Element.prototype.appendChild; Element.prototype.appendChild = function(...args){ try{ if(args[0].className.includes('ScCoreButton-sc-ocjdkq-0')){// Auto Channel Points Claimer document.querySelectorAll(".claimable-bonus__icon")[0].click() } }catch(err){// console.log(err); } return origAppendChild.apply(this, args); };