您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
count dog tags
当前为
// ==UserScript== // @name Torn Dog Tag Count // @namespace blank // @description count dog tags // @version 0.2 // @match *.torn.com/competition.php // @grant none // ==/UserScript== prevCount = 0; function checkTagCount(){ if(document.getElementsByClassName('dog-tag-list')[0]){ var tagCount = parseInt(document.getElementsByClassName('dog-tag-list')[0].getAttribute('data-from')); if(tagCount !== prevCount){ prevCount = tagCount; const dogTagTitle = document.getElementsByClassName('white-grad p10 top-round bold t-gray-6')[1]; dogTagTitle.innerHTML = 'Dog Tags you have collected ('+tagCount+')'; } } } checkTagCount(); const observer = new MutationObserver((mutations) => { for (const mutation of mutations) { for (const node of mutation.addedNodes) { checkTagCount(); } } }); const wrapper = document.querySelector('#mainContainer .content-wrapper'); observer.observe(wrapper, { subtree: true, childList: true });