腳本參考了完美格式列印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(控制臺)并按回車,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/296373.html
標籤:JavaScript
上一篇:Vuex 簡單使用
