@[toc]
[简书](https://greasyfork.org/zh-CN/scripts/by-site/jianshu.com?site=jianshu.com&q=%E7%AE%80%E4%B9%A6)
### 简书直接跳转
```javascript
简书直接跳转
使简书内页的网址直接跳转,而不是让用户手动复制链接
https://greasyfork.org/zh-CN/scripts/411059-简书直接跳转/code
// ==UserScript==
// @name 简书直接跳转
// @namespace github.com/axiref?to-jianshu
// @version 1.0
// @description 使简书内页的网址直接跳转,而不是让用户手动复制链接
// @author axiref
// @match https://www.jianshu.com/*
// ==/UserScript==
(function() {
'use strict';
let tags = document.getElementsByTagName("a")
for (let tag of tags) {
let u = tag.href
if (u.indexOf("jianshu.com/go?to=") !== -1) {
let index = u.search(/\?to=/) + 4;
let url = decodeURIComponent(u.substring(index));
tag.href = url;
}
}
})();
```
### 简书优化小助手(移除简书header标题)
```javascript
简书优化小助手
移除简书header标题
https://greasyfork.org/zh-CN/scripts/410010-简书优化小助手/code
// ==UserScript==
// @icon
// @name 简书优化小助手
// @namespace [url=mailto:1002615704@qq.com]1002615704@qq.com[/url]
// @author 炒饭包子
// @description 移除简书header标题
// @match *://www.jianshu.com/p/*
// @require http://cdn.bootcss.com/jquery/1.8.3/jquery.min.js
// @version 0.0.1
// @grant GM_addStyle
// ==/UserScript==
(function () {
'use strict';
$(function(){
// 移除头部
$("._1CSgtu").hide();
$(".VYwngI").hide();
// 移除尾部
$("footer").hide();
// 移除左侧
$("._3Pnjry").hide();
// 关闭推荐阅读
$(".ouvJEz:last").hide();
// 移除右侧
$("._2OwGUo").hide();
// 调整宽度
$("._gp-ck").width("1200");
// 移除打赏
$("._1kCBjS").hide();
$("._19DgIp").hide();
$("._13lIbp").hide();
$(".d0hShY").hide();
});
})();
```
### 简书净化
```javascript
简书净化
去简书内容页面广告
// ==UserScript==
// @name 简书净化
// @version 0.1
// @description 去简书内容页面广告
// @author buine
// @match https://www.jianshu.com/p/*
// @icon
// @grant none
// @require http://code.jquery.com/jquery-1.11.0.min.js
// @license MIT
// @namespace https://greasyfork.org/users/886916
// ==/UserScript==
(function() {
'use strict';
setTimeout(function() {
//<section class="-umr26" aria-label="xingchen-ad">
$(".-umr26").remove();
$("._27yofX").remove();
},1000);
})();
```
### segmentfault | 简书 免登录复制 复制去除版权信息
```javascript
// ==UserScript==
// @name segmentfault | 简书 免登录复制 复制去除版权信息
// @namespace http://tampermonkey.net/
// @version 0.15
// @description 无
// @author Peace&Love
// @include *://segmentfault.com/*
// @include *://www.jianshu.com/*
// @grant none
// ==/UserScript==
(function () {
"use strict";
if (window.location.href.indexOf("segmentfault") != -1) {
sf();
}
function sf() {
var fakeLogin = document.createElement("span");
fakeLogin.id = "SFUserId";
document.body.appendChild(fakeLogin);
document.querySelectorAll("article.article").forEach(function(t) {
t.addEventListener(
"copy",
function(e) {
e.stopPropagation();
},
true
);
});
}
document.addEventListener(
"copy",
function (e) {
e.stopPropagation();
},
true
);
})();
```
### 简书沉浸模式
```javascript
简书沉浸模式
优化简书的UI样式并去除广告
// ==UserScript==
// @name 简书沉浸模式
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 优化简书的UI样式并去除广告
// @author lnwazg
// @match https://www.jianshu.com/p/*
// @require https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// @grant none
// ==/UserScript==
(function() {
'use strict';
$(function(){
setTimeout(function(){
$("div._3Pnjry").remove();
$("div._2oDcyf").remove();
$("div._1kCBjS").remove();
$("div._19DgIp").remove();
$("div._13lIbp").remove();
$("div.d0hShY").remove();
$(".QxT4hD").hide();
$("._2Nttfz").remove();
$("aside").remove();
$("#note-page-comment").remove();
$("._gp-ck").width(1200);
$(".ouvJEz").removeAttr("background-color");
$(".VYwngI").hide();
},600);
});
})();
```
### 恢复简书图片
```javascript
恢复简书图片
恢复简书中无法显示的图片、调整简书布局为宽屏
// ==UserScript==
// @name 恢复简书图片
// @namespace http://tampermonkey.net/
// @version 0.3
// @description 恢复简书中无法显示的图片、调整简书布局为宽屏
// @author 山岚|ShanLan
// @match *://www.jianshu.com/p/*
// @grant none
// @require https://code.jquery.com/jquery-3.3.1.min.js
// ==/UserScript==
(function() {
'use strict';
// Your code here...
$.each($(".image-view > img"),function(i,obj){
var $o = $(obj);
var link = $o.attr("data-original-src");
$o.attr("src",link); $o.addClass("illustration");
$o.removeClass("image-loading");
var $fu = $(obj.parentNode); });
$(".image-view-maintain").removeClass("image-view-maintain");
//调整页面布局
//父级元素宽度
$("div[role=main]")[0].style.width = '80%';
//子元素
$("div[role=main]")[0].children[0].style.width = '100%';
//点赞框
$("#__next")[0].children[3].style.left = '5px';
})();
```
### JianShu Formatter 简书Markdown格式转换
```javascript
JianShu Formatter 简书Markdown格式转换
简书Markdown格式转换
// ==UserScript==
// @name JianShu Formatter 简书Markdown格式转换
// @namespace http://tampermonkey.net/
// @namespace https://www.jianshu.com/u/15893823363f
// @require https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js
// @version 3.2
// @description 简书Markdown格式转换
// @author Zszen
// @match https://www.jianshu.com/writer
// @grant none
// ==/UserScript==
(function() {
'use strict';
//var targetEditor = $("#arthur-editor");
initMe()
$("html").keypress(function(evt){
if(evt.originalEvent.charCode==27){
var bt_close_publish = $("div").filter(function(idx,el){return $(el).text()=='×'})
bt_close_publish.click()
initMe()
}
});
function initMe(){
setTimeout(function(){
var btUpdate = $("li");
if(!btUpdate){
initMe();
return;
}
//
//console.log( $("ul.clearfix"));
if($(".bt1f").length>0){
return
}
$("ul.clearfix").find('a').on('click',initMe);
btUpdate.on('click',initMe);
var addedBt = $('<li class="bt1f"><a class="fa format-code" data-action="">格</a></li>');
$("ul.clearfix").append(addedBt);
addedBt.on('click', formatInput)
addedBt = $('<li class="bt1f"><a class="fa insert-title" data-action="">插</a></li>');
$("ul.clearfix").append(addedBt);
addedBt.on('click', addTitle)
},800)
}
function formatInput(){
var txt = $("textarea");
//console.log(txt.val());
var str = txt.val();
str = str.replace(/···/g,'```')
str = str.replace(/·/g,'`')
str = str.replace(/〈|《/g,'<')
str = str.replace(/〉|》/g,'>')
//str = str.replace(//g,'<')
//str = str.replace(//g,'>')
str = str.replace(/「|『/g,'{')
str = str.replace(/』|」/g,'}')
//console.log(str);
txt.val(str)
}
function addTitle(){
var txt = $("textarea");
//var startPos = txt.selectionStart;
//console.log(startPos)
insertAtCursor(txt,"\n___\n####")
setSelectionRange(txt,txt.value.length,txt.value.length);
}
function insertAtCursor(myField, myValue) {
if (document.selection) {
//IE support
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
// sel.select();
} else if (myField.selectionStart || myField.selectionStart == '0') {
//MOZILLA/NETSCAPE support
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
var beforeValue = myField.value.substring(0, startPos);
var afterValue = myField.value.substring(endPos, myField.value.length);
myField.value = beforeValue + myValue + afterValue;
myField.selectionStart = startPos + myValue.length;
myField.selectionEnd = startPos + myValue.length;
// myField.focus();
} else {
//myField.value += myValue;
myField.val(myField.val()+myValue)
// myField.focus();
}
}
function setSelectionRange(input, selectionStart, selectionEnd) {
if (input.setSelectionRange) {
input.focus();
input.setSelectionRange(selectionStart, selectionEnd);
}else if (input.createTextRange) {
var range = input.createTextRange();
range.collapse(true);
range.moveEnd('character', selectionEnd);
range.moveStart('character', selectionStart);
range.select();
}
}
})();
```
###
```javascript
```
###
```javascript
```
###
```javascript
```
###
```javascript
```
###
```javascript
```
###
```javascript
```
###
```javascript
```
网友评论