// ==UserScript==
// @name 阅读模式
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://*/*
// @match https://*/*
// @require https://cdn.bootcdn.net/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
var fa=$("body");
var btn=$("<div id='chennimei'></div>");
var json={
"background":"#31e16d",
//"height":"36px",
"padding":"5px",
"cursor": "pointer",
"top":"50px",
"right":"2px",
"position": "fixed",
"z-index": 99999
};
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...
})();
tampermonkey 油猴例子
最新推荐文章于 2024-09-24 21:11:24 发布