在网页执行脚本

 

工具:

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

 

posted @ 2022-01-25 14:25  bookc  阅读(319)  评论(0编辑  收藏  举报