您的位置:首页 > 其它

打印CSDN博客内容格式脚本

2021-08-31 22:34 92 查看

脚本参考了完美格式打印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(控制台)并按回车。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: