// ==UserScript== // @name 补全a标签href属性 // @namespace Violentmonkey Scripts // @include * // @grant none // @version 1.2 // @author meazin // @license MIT // @description 2022/10/24 上午10:59:59 // @downloadURL none // ==/UserScript== var aElements=document.getElementsByTagName('a') for (const iterator of aElements) { if(!iterator['href']){ iterator['href']='javascript:;'; } }