You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
// ==UserScript==
|
|
// @name 银河任务完成自动跳过
|
|
// @namespace http://tampermonkey.net/
|
|
// @version 1.0
|
|
// @description 自动跳过银河任务完成弹出的页面
|
|
// @author Jack
|
|
// @match https://app.galxe.com/*
|
|
// @grant none
|
|
// ==/UserScript==
|
|
|
|
(function() {
|
|
'use strict';
|
|
|
|
// 定义CSS选择器
|
|
const selector = '#radix-:r35: > button > span.[&_svg]:text-inherit.[&_svg_path]:fill-current.[&_svg]:h-[1em].h-[1em].[&_svg]:w-[1em].w-[1em].text-base.cursor-pointer.text-common-white.sm:block.sm:text-size-24.block > svg';
|
|
|
|
// 监测页面元素
|
|
const observer = new MutationObserver(mutations => {
|
|
mutations.forEach(mutation => {
|
|
Array.from(mutation.addedNodes).forEach(node => {
|
|
if(node.matches && node.matches(selector)) {
|
|
// 点击按钮
|
|
node.click();
|
|
}
|
|
});
|
|
});
|
|
});
|
|
|
|
// 配置observer,观察子节点的变动
|
|
observer.observe(document.body, {
|
|
childList: true,
|
|
subtree: true
|
|
});
|
|
})(); |