您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
支持开启关闭
// ==UserScript== // @name 哔哩哔哩直播自动点赞 // @namespace https://jixiejidiguan.top/ // @version 2024-03-25 // @description 支持开启关闭 // @author jixiejidiguan.top // @match https://live.bilibili.com/* // @license AGPL-3.0-or-later // ==/UserScript== (function() { 'use strict'; var autoClickSwitch = document.createElement('button'); autoClickSwitch.id = 'autoClickSwitch'; autoClickSwitch.textContent = '自动点赞'; autoClickSwitch.style.position = 'fixed'; // 定位按钮 autoClickSwitch.style.right = '110px'; // 放置在屏幕右边 autoClickSwitch.style.bottom = '60px'; // 放置在屏幕底部 autoClickSwitch.style.zIndex = '9999'; // 确保按钮在最上层 var switchStatus = document.createElement('span'); switchStatus.id = 'switchStatus'; switchStatus.textContent = '关闭'; autoClickSwitch.appendChild(switchStatus); document.body.appendChild(autoClickSwitch); var clickInterval = null; autoClickSwitch.addEventListener('click', toggleAutoClick); function toggleAutoClick() { if (clickInterval) { clearInterval(clickInterval); clickInterval = null; switchStatus.textContent = '关闭'; } else { var elements = document.querySelectorAll('div[data-type="dianzan.0.show"]'); if (elements.length > 0) { clickInterval = setInterval(function() { elements.forEach(function(element) { try { element.click(); } catch (e) { console.error('Error clicking element:', e); } }); }, 1000); // 每隔1秒点击一次 switchStatus.textContent = '开启'; } else { console.log('没有找到可点击的元素。'); } } } window.addEventListener('DOMContentLoaded', function() { var elements = document.querySelectorAll('div[data-type="dianzan.0.show"]'); if (elements.length > 0) { console.log('页面加载完成,元素可用。'); } else { console.log('页面加载完成,但未找到可点击的元素。'); } }); })();