2014-12-19 118 views
0

我一直在尝试使用Tampermonkey过去3天,我没有得到任何地方(我是一个极端的新手)。到目前为止,我只是尝试在本地保存这些文件,看看Node.js是否可以保存我所做的更改,但没有运气。使用脚本永久更改页面

我需要改变

<a href="javascript:notFinished()" onmouseover="if(module_next.src == 'images/navbar/next.gif'){changeImages('module_next', 'images/navbar/next_o.gif'); tag('Go to next page'); return true;}" onmouseout="if(module_next.src == 'images/navbar/next.gif'){changeImages('module_next', 'images/navbar/next.gif'); return true;}" name="module_next_href" id="module_next_href">  

<a href="javascript:changePage(1)" onmouseover="if(module_next.src == 'images/navbar/next.gif'){changeImages('module_next', 'images/navbar/next_o.gif'); tag('Go to next page'); return true;}" onmouseout="if(module_next.src == 'images/navbar/next.gif'){changeImages('module_next', 'images/navbar/next.gif'); return true;}" name="module_next_href" id="module_next_href">  

它需要长期呆在这样的,在应用此我只是手动替换,但想通脚本是最好的。

+0

任何人都可以帮我解决这个问题 – user3602298

+0

有没有人有任何线索? – user3602298

+0

我仍然需要此帮助 – user3602298

回答

0

也许这样的脚本就是你要找的。根据需要进行自定义 - 它会找到与指定的href内容匹配的标签a的HTML元素,并对其进行更改。

// ==UserScript== 
// @name   E 
// @namespace  e 
// @version  1 
// @include  *google.com* 
// @grant   GM_log 
// @require  https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js 
// @run-at  document-end 
// ==/UserScript== 

// Find an element using jQuery 
var element = $("a[href='javascript:notFinished()']"); 

// Replace the href attribute of this element, if it exists 
if (element.length > 0) 
{ 
    element.attr('href', 'javascript:changePage(1)'); 
}