How do I change this Greasemonkey script to work on a different page?

181 Views Asked by At

I tried the script from How can I detect visited and unvisited links on a page?, and it works on the test page, but not on mine.

The answer, there, said that I need to change SelectorStr, but to what?
How do I check which are my options. I tried to search for ui.topicList and a.topicTItle but couldn't find anything on these values.

Edit (from a comment below):
I found this HTML in the page source:

<td class="plist"> 
    <a target="_top" href="/smartphones/clik-where-suppose.html" target="_self" ...

But, if set SelectorStr to td.plist a._top, It's still not working.

1

There are 1 best solutions below

2
On

I haven't tried the code but i guess you have to put a Selector String there. In the example two things are used. The first is an unordered list with the class name topicList and the second are links with the class topicTitle.

So if you want to apply that code with that SelectorStr your html should look something like this:

<ul class="topicList">
      <li><a class="topicTitle" href="#">listitem 1</a></li>
      <li><a class="topicTitle" href="#">listitem 2</a></li>
      <li><a class="topicTitle" href="#">listitem 3</a></li>
</ul>