您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
把知乎回答时间前置显示,方便甄别过时回答
// ==UserScript== // @name 知乎回答时间前置 // @namespace http://tampermonkey.net/ // @version 2024-02-27 // @description 把知乎回答时间前置显示,方便甄别过时回答 // @author Jiny3213 // @match https://www.zhihu.com/question/* // @icon https://www.google.com/s2/favicons?sz=64&domain=zhihu.com // @grant unsafeWindow // @run-at document-start // @license MIT // ==/UserScript== // 调整回答时间位置 function exchangeTimeDom() { console.log('do it') const answers = document.querySelectorAll('.AnswerItem') for(let answer of answers) { const content = answer.querySelector('.RichContent') const time = answer.querySelector('.ContentItem-time') answer.insertBefore(time, content) } } // 劫持fetch方法来自 https://cloud.tencent.com/developer/article/2123940 (function () { const originFetch = fetch; window.unsafeWindow.fetch = (url, options) => { return originFetch(url, options).then(async (response) => { if(url.match(/\/feeds\?/)){ exchangeTimeDom() return response; }else{ return response; } }); }; })(); window.unsafeWindow.document.addEventListener("DOMContentLoaded", exchangeTimeDom) window.unsafeWindow.onload = exchangeTimeDom;