打印CSDN博客内容格式脚本

x33g5p2x  于2021-11-14 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(154)

脚本参考了完美格式打印CSDN博客内容,删除了一些博客内容无关的信息。使用方法:打开CSDN博文内容,按“F12”——>选择“控制台”——>将以上脚本复制放入Chrome开发者选项里边的console(控制台)并按回车。

脚本参考了完美格式打印CSDN博客内容,删除了一些博客内容无关的信息,代码如下:

(function(){
$("#side").remove();
$("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
$(".nav_top_2011, #header, #navigator").remove();
$(".csdn-side-toolbar,.template-box,.reward-user-box").remove();
$(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box,#dmp_ad_58").remove();
$("aside").remove();
$(".tool-box").remove();
$("#blogColumnPayAdvert").remove();
$("#toolBarBox").remove();
$(".recommend-tit-mod").remove();
$("#copyright-box").remove();
$(".operating").remove();
$(".article-info-box").remove();//出处信息
$("main").css('display','content'); 
$("main").css('float','left'); 
$("#mainBox").css('width','1048px');
$("#mainBox").css('margin-left','20px');
$("#mainBox").css('margin-right','0px');
//$("[class='main_father clearfix d-flex justify-content-center']").css("width","1048px");
$(".main_father.clearfix.d-flex.justify-content-center").css("width","1048px");
window.print();
$("tool-box").remove();
})();

使用方法:打开CSDN博文内容,按“F12”——>选择“控制台”——>将以上脚本复制放入Chrome开发者选项里边的console(控制台)并按回车。

相关文章

微信公众号

最新文章

更多