打开你的 tampermonkey 然后
在 标题头上面添加 @require 后面是一个jq的文件地址。你可以查找Jquery的官方CDN加速。
// @require http://code.jquery.com/jquery-1.11.0.min.js
测试:CSDN阅读模式;
(function() {
'use strict';
var fa=$("body");
var btn=$("<li></li>");
var json={
"background":"#31e16d",
"height":"16px",
"padding":"5px",
"cursor": "pointer",
"top":"300px",
"right":"80px",
"position": "fixed"
};
btn.css(json);
btn.html("<span id='lfsenior'>开启阅读模式</span>");
fa.append(btn);
var bodywidth=$("#body").css("width");
var mainwidth=$("#main").css("width");
btn.click(function () {
if($("#lfsenior").html()=="开启阅读模式"){
$("#lfsenior").html("关闭阅读模式");
$("#body").css("width","100%");
$("#main").css("width","100%");
$(".csdn-tracking-statistics").hide();
$("#article_content").siblings(".similar_article").hide();
$("#res-relatived").hide();
$("#side").hide();
$("#comment_title").parent("div").hide();
$("#pub_footerall").parent("div").hide();
}else{
console.log(3435);
console.log(456);
$("#lfsenior").html("开启阅读模式");
$("#body").css("width",bodywidth);
$("#main").css("width",mainwidth);
$(".csdn-tracking-statistics").show(1000);
$("#article_content").siblings(".similar_article").show(1000);
$("#res-relatived").show(1000);
$("#side").show(1000);
$("#comment_title").parent("div").show(1000);
$("#pub_footerall").parent("div").show(1000);
}
});
// Your code here...
})();