您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
使用该脚本可以完整的打印知乎专栏的内容。
当前为
// ==UserScript== // @name 方便知乎专栏的打印/Facilitate the PDF printing for the zhihu // @namespace http://tampermonkey.net/ // @version 1.0 // @description 使用该脚本可以完整的打印知乎专栏的内容。 // @author Huoleeeeee // @match *://zhuanlan.zhihu.com/* // @require http://code.jquery.com/jquery-1.11.0.min.js // @grant unsafeWindow // ==/UserScript== (function() { 'use strict'; var fa=$("body"); var btn=$("<li></li>"); var h = $(document).height()-$(window).height(); var json={ "background":"#31e16d", "height":"16px", "padding":"5px", "cursor": "pointer", "top":"300px", "right":"80px", "position": "fixed" }; btn.css(json); //添加按钮 btn.html("<span id='lfsenior'>打印成pdf</span>"); fa.append(btn); var bodywidth=$("#body").css("width"); var mainwidth=$("#main").css("width"); btn.click(function () { //滑动到底部加载所有图片 //网速不够的话可以调大该时间 $("html,body").animate({ scrollTop: h }, 500); btn.hide(); //滑动完之后再打印 setTimeout(function () { $(".ContentItem-actions").remove(); $(".ColumnPageHeader-Wrapper").remove(); $(".PostIndex-Contributions").remove() $(".Recommendations-Main").remove() $(".Comments-container").remove() window.print(); $(document).scrollTop(0); location.reload(); //网速不够的话可以调大该时间 }, 600); }); })();