在網頁執行腳本

 

工具:

  1. 谷歌或EDGE瀏覽器
  2. 安裝 tampermonkey 插件

步驟:

  1. 打開需要指定腳本的網站
  2. 點擊tampermonkey 插件
  3. 選中新增腳本
  4. 開始編輯你的腳本

 

例如:

以 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();
})();

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章