// ==UserScript== // @name 知乎增强 - 一键收起回答 // @name:zh-CN 知乎增强 - 一键收起回答 // @name:zh-TW 知乎增強 - 壹鍵收起回答 // @version 1.0.1 // @author X.I.U // @description 在知乎右下角添加「一键收起回答」按钮,点击后可以收起所有长篇回答。 // @description:zh-CN 在知乎右下角添加「一键收起回答」按钮,点击后可以收起所有长篇回答。 // @description:zh-TW 在知乎右下角添加「壹鍵收起回答」按鈕,點擊後可以收起所有長篇回答。 // @include *://www.zhihu.com/question/* // @include https://www.zhihu.com/ // @icon https://static.zhihu.com/static/favicon.ico // @require https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js // @license GPL-3.0 License // @run-at document-end // @namespace https://greasyfork.org/scripts/412205 // ==/UserScript== (function() { var button_Add = `` var style_Add = document.createElement('style'); style_Add.innerHTML = '.CornerButton{margin-bottom:8px !important;}.CornerButtons{bottom:45px !important;}'; document.head.appendChild(style_Add); $(".CornerAnimayedFlex").prepend(button_Add); $("#collapsed-button").on("click", function () { document.querySelectorAll('.ContentItem-rightButton').forEach(function (el) { if (el.attributes[0].name === "data-zop-retract-question") { el.click() } }); }) })();