微博免登陆查看全文辅助脚本

不用登陆即可查看全文,替换原来的查看全文文字以及链接,点击直接跳转到全文。

目前為 2021-07-30 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         微博免登陆查看全文辅助脚本
// @namespace    zzy,q82664730
// @version      0.6
// @description  不用登陆即可查看全文,替换原来的查看全文文字以及链接,点击直接跳转到全文。
// @author       zzy
// @match        *://www.weibo.com/*
// @icon         https://img.t.sinajs.cn/t6/style/images/global_nav/WB_logo.png?id=1404211047727
// @grant        none
// ==/UserScript==
 
(function() {
  //'use strict';
  function showLink(){
    for(var i=0;i<document.querySelectorAll(".WB_text a.WB_text_opt").length;i++){
      var pa = document.querySelectorAll(".WB_text a.WB_text_opt")[i].parentNode;
      var lj = document.createElement("a");
      lj.href = document.querySelectorAll(".WB_text a.WB_text_opt")[i].href;
      document.querySelectorAll(".WB_text  a.WB_text_opt")[i].remove();
      pa.appendChild(lj);
      lj.innerHTML = "<span class='addA' style='color:#4D0000; font-size:1.2em;font-weight:bold;'>点我去真实链接,免登录查看全文</span>";
    }
  }
  showLink();
  function CHcolor() {
    var color="#f00|#0f0|#00f|#880|#808|#088|green|blue|gray";
    color=color.split("|");
    for(var i=0;i<document.getElementsByClassName("addA").length;i++){
      document.getElementsByClassName("addA")[i].style.color=color[parseInt(Math.random() * color.length)];
    }
  }
  function zf(){
    showLink();
    let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
    let element = document.getElementById("plc_main");
    var observer = new MutationObserver(() => {
      showLink();
    })
    observer.observe(element, { attributes: true, childList: true, subtree: true })
  }
  setInterval("CHcolor",200);
  setTimeout(zf,4000);
})();