weibo-directlink

a Tampermonkey script that is used to replace Weibo's link to its's original value

  1. // ==UserScript==
  2. // @name weibo-directlink
  3. // @namespace https://github.com/phith0n/tampermonkey
  4. // @version 1.0.0
  5. // @author phith0n
  6. // @description a Tampermonkey script that is used to replace Weibo's link to its's original value
  7. // @match *://t.cn/*
  8. // @run-at document-end
  9. // ==/UserScript==
  10. (function() {
  11. 'use strict';
  12. const links = document.getElementsByClassName("link");
  13. if (links.length > 0 && /长按网址复制/.test(document.body.innerHTML)) {
  14. const link = links[0];
  15. const a = document.createElement("a");
  16. a.href = link.innerText;
  17. document.body.appendChild(a);
  18. a.click();
  19. }
  20.  
  21. })();