I have this Greasemonkey script, I originally wanted to get all the elements and search through those for but I couldn\'t get that to work. So I tri 相关标签: 2条回答 野的像风 2021-01-27 08:47 Maybe make the condition a little looser? Maybe instead of: results[i].href.indexOf("http://www.unwantedsites.com") == 0 ) do: results[i].href.indexOf("unwantedsites.com") >= 0 ) 0 讨论(0) 发布评论: 提交评论 加载中... 礼貌的吻别 2021-01-27 08:56 try using getAttribute instead of directly accessing the property href: if ( results[i].getAttribute("href").indexOf("http://www.unwantedsites.com") == 0 ) { 0 讨论(0) 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
elements and search through those for but I couldn\'t get that to work. So I tri 相关标签: 2条回答 野的像风 2021-01-27 08:47 Maybe make the condition a little looser? Maybe instead of: results[i].href.indexOf("http://www.unwantedsites.com") == 0 ) do: results[i].href.indexOf("unwantedsites.com") >= 0 ) 0 讨论(0) 发布评论: 提交评论 加载中... 礼貌的吻别 2021-01-27 08:56 try using getAttribute instead of directly accessing the property href: if ( results[i].getAttribute("href").indexOf("http://www.unwantedsites.com") == 0 ) { 0 讨论(0) 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复 热议问题
Maybe make the condition a little looser? Maybe instead of:
results[i].href.indexOf("http://www.unwantedsites.com") == 0 )
do:
results[i].href.indexOf("unwantedsites.com") >= 0 )
try using getAttribute instead of directly accessing the property href:
href
if ( results[i].getAttribute("href").indexOf("http://www.unwantedsites.com") == 0 ) {