// ==UserScript== // @icon http://fund.eastmoney.com/favicon.ico // @name 天天基金-自选基金估值自动刷新 // @namespace https://github.com/ekoooo/tampermonkey_eastmoney_auto_refresh // @version 0.1.2 // @description 天天基金-自选基金-估值自动刷新 // @author liuwanlin // @match *://favor.fund.eastmoney.com // @match *://favor.fund.eastmoney.com/#mykfs // @grant unsafeWindow // @downloadURL https://update.greasyfork.icu/scripts/392124/%E5%A4%A9%E5%A4%A9%E5%9F%BA%E9%87%91-%E8%87%AA%E9%80%89%E5%9F%BA%E9%87%91%E4%BC%B0%E5%80%BC%E8%87%AA%E5%8A%A8%E5%88%B7%E6%96%B0.user.js // @updateURL https://update.greasyfork.icu/scripts/392124/%E5%A4%A9%E5%A4%A9%E5%9F%BA%E9%87%91-%E8%87%AA%E9%80%89%E5%9F%BA%E9%87%91%E4%BC%B0%E5%80%BC%E8%87%AA%E5%8A%A8%E5%88%B7%E6%96%B0.meta.js // ==/UserScript== (function($) { 'use strict'; // 请求接口地址 var URL = 'https://api.fund.eastmoney.com/Favor/Get?&callback=?'; // 选择器 var TABLE_SELECTOR = '.js-fundlist-table'; // 始化失败次数 var INIT_CHECK_FAIL_NUMBER = 0; $(` `).appendTo("head"); // 检查并开始 function init() { setTimeout(function() { if($(TABLE_SELECTOR + ' tbody tr').length) { injectTemplate2Table(); startGetDataTimer(); }else { ++INIT_CHECK_FAIL_NUMBER; INIT_CHECK_FAIL_NUMBER <= 20 && init(); } }, 500); } // 注入模板给表格中 function injectTemplate2Table() { const columnIndex = 2; const table = $(TABLE_SELECTOR); const tbody = table.find('tbody'); const th = table.find('thead th'); // 隐藏原来的列 table.find('.js-gsz, .js-gszzl').hide(); th.eq(2).hide(); th.eq(3).hide(); // 注入表格头 table.find('thead th').eq(columnIndex - 1).after(`
估值 | -
涨幅
-
-