使用油猴脚本,阻止羽雀在新标签页中展示(基于油猴脚本修改)

// ==UserScript==
// @name         阻止新标签页打开
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       logeast
// @match        *://*.yuque.com/*
// @grant        none
// ==/UserScript==

(function () {
  "use strict";

  // Your code here...
  const removeATarget = () => {
    [...document.querySelectorAll("a")].map((item) => {
      item.target = "_self";
    });
  };

  ["load", "hashchange"].forEach((item) => {
    window.addEventListener(item, removeATarget);
  });
})();
最后修改:2020 年 07 月 08 日
如果觉得我的文章对你有用,请随意赞赏