Greasy Fork is available in English.
自动点击!
当前为
// ==UserScript==
// @name good target click
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 自动点击!
// @author lich
// @match https://xie.infoq.cn/link?target=*
// @match https://cloud.tencent.com/developer/tools/blog-entry?target=*
// @match https://nav.qixinpro.com/sites/*
// @match https://link.csdn.net/?target=*
// @icon https://www.google.com/s2/favicons?sz=64&domain=infoq.cn
// @grant none
// @run-at document-end
// @license MIT
// ==/UserScript==
/**
* 如何开始
* 将需要添加的附属到 function是类上
*/
(function() {
'use strict';
var count = 100;
var functions = {}
var href = window.location.href;
function lazyTrigger(func) {
var dom = func()
if(count-- <0 || dom) {
dom && (function(dom) {
dom.target && (dom.target = '')
dom.click()
})(dom)
return;
}
setTimeout(function() {
lazyTrigger(func)
}, 200);
}
// infoq
functions['infoq.cn'] = function() {
return document.querySelector('.Button_button_3onsJ');
}
// cloud.tencent.com/developer
functions['cloud.tencent.com/developer'] = function() {
return document.querySelector('.mod-external-link-btn a');
}
// nav.qixinpro.com/sites
functions['nav.qixinpro.com/sites'] = function() {
return document.querySelector('.site-go-url a');
}
// csdn
functions['link.csdn.net'] = function() {
return document.querySelector('#apesar-loading');
}
Object.keys(functions).forEach(key => {
if (href.includes(key)) {
lazyTrigger(functions[key])
}
})
})();