您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
自动选择未腐化,Auto uncheck "Corrupted", path of exile, 流放之路,支持Clear按钮后重新选择
// ==UserScript== // @name Auto check "Non-Corrupted" for path of exile1 trade site 流放之路交易网站自动选择未腐化 // @namespace http://tampermonkey.net/ // @version 0.4.2 // @description 自动选择未腐化,Auto uncheck "Corrupted", path of exile, 流放之路,支持Clear按钮后重新选择 // @author Znm // @match https://www.pathofexile.com/trade // @match https://www.pathofexile.com/trade/search/* // @exclude https://www.pathofexile.com/trade/search/*/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // 页面加载完成后执行 window.addEventListener('load', function() { setTimeout(function() { selectCorruptedDropdownOption(); addClearButtonListener(); }, 1500); }); // 选择Corrupted下拉列表中的"No"选项 function selectCorruptedDropdownOption() { const filterTitles = document.querySelectorAll('div.filter-title'); const targetFilterTitle = Array.from(filterTitles).find(title => title.innerText.trim() === 'Corrupted' ); if (!targetFilterTitle) { return; } const filterBody = targetFilterTitle.closest('.filter-body'); if (!filterBody) { return; } const dropdownContainer = filterBody.querySelector('div.multiselect.filter-select'); if (!dropdownContainer) { return; } const multiselectInput = dropdownContainer.querySelector('input.multiselect__input[placeholder="Any"]'); if (!multiselectInput) { return; } multiselectInput.click(); setTimeout(function() { const targetOptionText = 'No'; const optionsList = dropdownContainer.querySelector('ul.multiselect__content'); if (!optionsList) { return; } const options = optionsList.querySelectorAll('li.multiselect__element span.multiselect__option'); const foundOption = Array.from(options).find(option => option.innerText.trim() === targetOptionText ); if (foundOption) { foundOption.click(); } }, 500); } // 添加Clear按钮监听器 function addClearButtonListener(retryCount = 0) { const clearButton = document.querySelector('button.btn.clear-btn'); if (clearButton) { clearButton.addEventListener('click', function() { setTimeout(function() { selectCorruptedDropdownOption(); }, 1000); }); } else if (retryCount < 3) { setTimeout(function() { addClearButtonListener(retryCount + 1); }, 2000); } else { console.error('未找到Clear按钮,已停止尝试'); } } })();