工具:
- 谷歌或EDGE浏览器
- 安装 tampermonkey 插件
步骤:
- 打开需要指定脚本的网站
- 点击tampermonkey 插件
- 选中新增脚本
- 开始编辑你的脚本
例如:
以 Java技术栈 为例,正常查看文章需要关注公众账号来解决查看全文,添加脚本后,无需关注公众号即可查看
// ==UserScript==
// @name Java技术栈
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://www.javastack.cn/article*
// @icon https://www.google.com/s2/favicons?domain=javastack.cn
// @grant none
// ==/UserScript==
(function() {
'use strict';
// Your code here...
document.getElementById("article-details").removeAttribute("style");
document.getElementById("read-more").remove();
})();