一个监测交易数据的工具插件
目前為
// ==UserScript== // @name DexFilterTool // @namespace http://www.seallon.com/ // @version 1.0 // @description 一个监测交易数据的工具插件 // @author RaoXinLong // @match https://www.dextools.io/* // @match https://photon-sol.tinyastro.io/* // @grant none // @require https://unpkg.com/[email protected]/dist/ajaxhook.min.js // @require https://code.jquery.com/jquery-2.1.4.min.js // @license MPL-2.0 // ==/UserScript== (function() { 'use strict'; var configDom; function InitConfig(){ var configDom = document.createElement('div'); configDom.innerHTML = ''; configDom.style.cssText="max-width:60%;min-width: 200px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 10%;left: 90%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;"; document.body.appendChild(configDom); } function Toast(msg,duration){ duration=isNaN(duration)?3000:duration; var m = document.createElement('div'); m.innerHTML = msg; m.style.cssText="max-width:60%;min-width: 200px;padding:0 14px;height: 40px;color: rgb(255, 255, 255);line-height: 40px;text-align: center;border-radius: 4px;position: fixed;top: 10%;left: 90%;transform: translate(-50%, -50%);z-index: 999999;background: rgba(0, 0, 0,.7);font-size: 16px;"; document.body.appendChild(m); setTimeout(function() { var d = 0.5; m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in'; m.style.opacity = '0'; setTimeout(function() { document.body.removeChild(m) }, d * 1000); }, duration); } Toast("插件启动成功!!"); var hostname = location.hostname; if(hostname =='www.dextools.io') { Toast(hostname); }else if(hostname =='photon-sol.tinyastro.io') { //Toast(hostname); setTimeout(function () { var items = $('.c-trades-table__scroll .c-grid-table__body'); $(items[0]).on("DOMSubtreeModified", function() { var list = $(items[0]).find(".c-grid-table__tr"); for(var i=0;i<10;i++) { var childrenObj = $(list[i]).children("*"); var totalU = $(childrenObj[3]).html().replace("$",""); if(totalU.indexOf("K")<0){ var floatU = parseFloat(totalU); if(floatU<500){ $(list[i]).remove(); }else{ $(childrenObj[3]).attr("style","font-size:22px;"); } }else{ $(childrenObj[3]).attr("style","font-size:22px;"); } } Toast("插件监测中..."); }); }, 1000); } })();