您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
v2ex站点增强插件.增强评论查看模式。
当前为
// ==UserScript== // @name v站增强 // @namespace https://www.yffjglcms.com/ // @version 0.1.0.20210321 // @description v2ex站点增强插件.增强评论查看模式。 // @author yffjglcms // @match https://v2ex.com/t/* // @grant none // ==/UserScript== (function() { 'use strict'; // Your code here... // 获取数据 let data = []; let map = new Map(); let boxName = "v2Box"; let boxNameSelector = ".v2Box"; let msgBox = `<div class='box ${boxName}' style='position: absolute;width: 270px; padding: 5px;'></div>`; fetchData(); function fetchData() { $(".cell strong a").each((idx, e) => { let _this = $(e); let _cell = _this.parents(".cell"); let author = _this.html(); let no = _cell.find(".no").html(); console.log(author); console.log(no); if (!map.has(author)) { map.set(author, []); } map.get(author).push(_cell.html()); }); console.log(map); } // 绑定事件 $(".reply_content a").hover( (e) => { let _this = $(e.currentTarget); let parent = _this.parents(".cell"); let author = _this.html(); if ($(boxNameSelector).length > 0) { $(boxNameSelector).remove(); } $(parent).before(msgBox); $(boxNameSelector).css("left", Rightbar.offsetLeft); $(boxNameSelector).html(map.get(author)); }, () => { // console.log("2-1"); // $(boxNameSelector).remove(); // console.log("2-2"); } ); })();