change link colors from JavaScript?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mike

    change link colors from JavaScript?

    I'm writing a FireFox extension and I have the dom and therefor the
    links[] collection

    window.getBrows er().contentDoc ument.links[i]

    Is there a way to change the color of these links based on the stuff I'm
    checking for from the JavaScript?

    For example. If I have this loop
    var number_of_links = window.getBrows er().contentDoc ument.links.len gth;

    for (var i=0; i < number_of_links ; i++)
    {
    var domain = window.getBrows er().contentDoc ument.links[i].hostname;
    //Check hostname here and change color
    }

    how could I change the links color?

    thanks
    mike


  • Fred Oz

    #2
    Re: change link colors from JavaScript?

    mike wrote:[color=blue]
    > I'm writing a FireFox extension and I have the dom and therefor the
    > links[] collection
    >
    > window.getBrows er().contentDoc ument.links[i]
    >
    > Is there a way to change the color of these links based on the stuff I'm
    > checking for from the JavaScript?
    >
    > For example. If I have this loop
    > var number_of_links = window.getBrows er().contentDoc ument.links.len gth;
    >
    > for (var i=0; i < number_of_links ; i++)
    > {
    > var domain = window.getBrows er().contentDoc ument.links[i].hostname;
    > //Check hostname here and change color
    > }
    >
    > how could I change the links color?
    >[/color]

    Whilst this is a general ECMA/JavaScript/JScript news group, I
    think Firefox extensions are a little outside the knowledge of
    most posters here.

    You may get quicker/better help here:

    <URL:http://forums.mozillaz ine.org/viewforum.php?f =19>

    --
    Fred

    Comment

    Working...