工具:
- 谷歌或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(); })();