Greasemonkey, delete element

后端 未结 2 1392
不知归路
不知归路 2021-01-27 07:57

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)
提交回复
热议问题