mysql常用的tamper脚本,tampermonkey 实用脚本

@2018/11/29

使用背景

自从开始使用高分屏的 thinkpad,我总觉得那些经常光顾的网站字体太小,看起来既费劲又容易睡觉,因此就想着把它们调大一点。

为了从系统层面解决这一问题,我加大了系统的整体字号:

拒绝使用百分比缩放图标尺寸

那样无论使用什么字体、怎么调整,都会模糊

使用仅更改字体大小

将下拉列表项的字体全部设置为 10 号(默认9号)。

1460000017199159?w=885&h=369

做了以上设置,打开资源管理器以及安装的软件,字体都要大一些,看起来能够适应了。但是浏览器打开的网站,他们都有各自的字号,还是有些偏小。尤其是 github。所以我还得折腾一下浏览器。

一般情况下,调整浏览器默认字体大小,我们可以在设置里面修改字体,或者按住Ctrl+鼠标滚轮临时放大浏览器页面就可以了。但是也有一些问题:

设置修改的是全局字体,字体过大,一些网站的导航栏会显示异常,比如字体显示一半或者不能正常显示

放大页面,页面布局会发生变化,有时候甚至扭曲变形

所以后来我就想到了用 F12 直接来修改字号,但是每次都这么改必然很蛋疼,有没有脚本啥的?有!

Tampermonkey 是一款免费的浏览器扩展和最为流行的用户脚本管理器,它适用于 Chrome, Microsoft Edge, Safari, Opera Next, 和 Firefox。

Greasy Fork 是一个免费的脚本商城,它的脚本可以直接在 Tampermonkey 中安装和使用。

下面就是我常用的一些脚本,包括别人提交到 Greasy Fork 的在线脚本,以及我自己临摹的的一些 js 代码(只能在本地添加使用)。

这些脚本的大部分目的都是为了修改页面宽度、字体大小,以及屏蔽一些广告。

我不懂 JavaScript,其中的自有脚本是使用过程中用 F12 一步一步积累出来的,肯定写得不好,欢迎指正。

有行家能帮我合并这些分散的脚本到一个脚本了么?求指点。

现成脚本

自有脚本

修改有道云笔记分享页面宽度

为了方便在其它地方安装,这个脚本我提交到了 Greasy Fork。

地址:修改有道云笔记分享页面宽度

// ==UserScript==

// @name 修改有道云笔记分享页面宽度

// @namespace http://tampermonkey.net/

// @version 0.2

// @description 修改有道云笔记分享页面宽度,以便更加适合阅读。

// @author High Jiang

// @match *://note.youdao.com/share/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.file{ min-width: 256px; max-width: 1080px; width: 100%; padding-left: 0px; padding-right: 0px;} .file-name-container{ padding-left: 5%;}';

document.head.appendChild(style);

})();

Better github read

为了方便在其它地方安装,这个脚本我提交到了 Greasy Fork。

地址:Better github read

// ==UserScript==

// @name Better github read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description 调整Github页面宽度及字体大小,以便更加适合阅读。

// @author High Jiang

// @match https://github.com/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.markdown-body{ font-size: 1.4em } .repository-content{ min-width: 256px; max-width: 1080px; width: 100% } .discussion-timeline{ min-width: 256px; max-width: 1080px; width: 100%; } .container{max-width: 1080px; width: 100%;}';

document.head.appendChild(style);

//.timeline-new-comment{max-width: 1080px; width: 100%;}

var items = document.querySelectorAll('#wiki-content, #discussion_bucket');

for (var i = 0; i < items.length; i++) {

items[i].style.width = "1320px";

}

})();

Better CSDN read

// ==UserScript==

// @name Better CSDN read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description try to take over the world!

// @author You

// @match *://blog.csdn.net/*

// @run-at document-end

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.recommend-right{ visibility: hidden; } .fourth_column{ visibility: hidden; } .recommend-box{ visibility: hidden; }'

document.head.appendChild(style);

document.getElementById("asideFooter").remove();

document.getElementById("dmp_ad_58").remove();

})();

Better gopl read

// ==UserScript==

// @name Better gopl read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description 调整 Gopl 页面宽度及字体大小,以便更加适合阅读。

// @author High Jiang

// @match *://b.ykfq.me/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.page-inner{ max-width: 1080px; width: 100%; font-size: 16px}';

document.head.appendChild(style);

})();

Better zhihu Read

// ==UserScript==

// @name Better zhihu Read

// @namespace https://www.zhihu.com

// @version 0.1

// @description 去掉知乎问题页侧边栏并进行界面居中优化

// @author High Jiang

// @match *://www.zhihu.com/question/*

// @run-at document-start

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML =".Question-mainColumn { max-width: 1080px; width: 100%; padding-bottom: 20px;} .Question-sideColumn{width: 0}"

document.head.appendChild(style);

})();

Better medium read

// ==UserScript==

// @name Better medium read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description 调整 Medium 页面宽度及字体大小,以便更加适合阅读。

// @author High Jiang

// @match https://medium.com/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.postArticle--full .sectionLayout--insetColumn{ max-width: 1080px; width: 100%; font-size: 16px}';

document.head.appendChild(style);

document.getElementsByClassName("u-marginAuto u-maxWidth1000 js-postLeftSidebar")[0].remove()

})();

Better jobbole read

// ==UserScript==

// @name Better jobbole read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description 调整 伯乐在线 页面宽度及字体大小,以便更加适合阅读。

// @author High Jiang

// @match *://*.jobbole.com/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.container .grid-8 .container{ max-width: 940px; width: 100% } .grid-8{ max-width: 940px; width: 100% } .grid-4{ max-width: 450px; width: 100% }'

document.head.appendChild(style);

//document.getElementsByClassName("u-marginAuto u-maxWidth1000 js-postLeftSidebar")[0].remove()

})();

Better Ceph read

// ==UserScript==

// @name Better Ceph read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description try to take over the world!

// @author You

// @match *://docs.ceph.com/*

// @match *://docs.ceph.org.cn/*

// @run-at document-end

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.document{ font-size: 17px; }'

document.head.appendChild(style);

document.getElementById("asideFooter").remove();

})();

Better prometheus read

// ==UserScript==

// @name Better prometheus read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description 调整Github页面宽度及字体大小,以便更加适合阅读。

// @author High Jiang

// @match https://prometheus.io/docs/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.container{max-width: 1320px; width: 100%; } .col-md-9{width: 80%;} .col-md-3{ width: 20%; } .doc-content{ font-size: 18px;} .toc-right{ width: 30%; } '

document.head.appendChild(style);

})();

Better OpenStack read

// ==UserScript==

// @name Better OpenStack read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description 调整 OpenStack 文档中心页面宽度及字体大小,以更加适合阅读。

// @author High Jiang

// @match https://docs.openstack.org/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

document.getElementsByClassName("container docs-book-wrapper")[0].style= "width: 1366px; font-size: 18px"

})();

Better jianshu read

// ==UserScript==

// @name Better jianshu read

// @namespace http://tampermonkey.net/

// @version 0.1

// @description 调整 伯乐在线 页面宽度及字体大小,以便更加适合阅读。

// @author High Jiang

// @match https://www.jianshu.com/*

// @grant none

// ==/UserScript==

(function() {

'use strict';

var style = document.createElement('style');

style.innerHTML = '.note .post{ max-width: 960px; width: 100% }'

document.head.appendChild(style);

document.getElementById("web-note-ad-fixed").remove()

})();

Better StackOverflow read

没搞定,欢迎补充。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值