您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Github 长按 star, 一键 watch, star, fork
当前为
// ==UserScript== // @name Github 素质三连 // @namespace http://tampermonkey.net/ // @version 0.1 // @description Github 长按 star, 一键 watch, star, fork // @author liubiantao // @match https://*.github.com/* // @run-at document-end // @grant none // ==/UserScript== ;(function() { 'use strict' const starButton = document.querySelectorAll( 'button.btn.btn-sm.btn-with-count.js-toggler-target' )[1] const watchButton = document.querySelector('button[value=release_only]') const forkButton = document.querySelector('.octicon-repo-forked') .parentElement const getTimeNow = () => new Date().getTime() let timeStart, timeEnd, time let playing = false function playAnimation() { playing = true console.warn('playAnimation') } function stopAnimation() { playing = false console.warn('stopAnimation') } function combo() { starButton.click() watchButton.click() forkButton.click() } function holdDown() { timeStart = getTimeNow() time = setInterval(function() { timeEnd = getTimeNow() if (timeEnd - timeStart > 200) { !playing && playAnimation() } if (timeEnd - timeStart > 1500) { clearInterval(time) combo() } }, 100) } function holdUp() { clearInterval(time) playing && stopAnimation() } starButton.addEventListener('mousedown', holdDown) starButton.addEventListener('mouseup', holdUp) })()