1 // ==UserScript== 2 // @name JSHE_ModifyFunction 3 // @namespace jshe 4 // @include http://localhost/* 5 // @version 1 6 // @grant none 7 // ==/UserScript== 8 9 alert("hello2"); 10 11 function embed() { 12 var cells =document.getElementsByTagName("a"); 13 for (var i = 0; i < cells.length; i++) 14 { 15 var href = cells[i].getAttribute("href"); 16 cells[i].setAttribute("href", href + "/dummy"); 17 } 18 } 19 20 21 var script = document.createElement(‘script‘); 22 script.type = "text/javascript"; 23 //script.innerHTML = "(" + embed + ")()"; 24 script.innerHTML = embed + "\nembed();"; 25 document.getElementsByTagName(‘body‘)[0].appendChild(script); 26 27 alert("hello3");
时间: 2024-10-13 10:40:36