Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Doesn't handle relative icon URLs

2011-04-08
2013-05-30
  • Philipp Hanes
    Philipp Hanes
    2011-04-08

    Not a very common occurrence, but one that seems easy enough to handle (and I've hit it a few times) is when a web page refers to its ICON link as "../../icons/favicon.ico" or the like.
    Would it be difficult to add some way to handle that?

    Thanks again for a very useful plugin.

        Philipp

     
  • Luckyrat
    Luckyrat
    2011-05-04

    Hi Philipp,

    Do you have an example site where this happens?

    The plugin automatically loads the home page for any domain rather than the particular URL stored in an entry so relative URLs wouldn't work on the page the plugin looks at anyway.

    I suspect modern browsers will now permit more than one favicon per domain and this is a feature I'll try to add in the next version which should be released soon.

    Whether that will be enough to get relative URLs working I'm not certain but it's definitely at least a step in the right direction.

    Thanks,
    Chris

     
  • Philipp Hanes
    Philipp Hanes
    2011-06-17

    Actually, I'm not finding anything right now, and it could be that I was visiting a site that is configured like
         http://www.wyndhamrewards.com/
    Which redirects immediately to a different page, which in turn has a relative icon (which is irrelevant, since you're not looking at that page anyway)
    So I guess the catch is two-fold.
      1) following redirects
      2) handling relative URLs on redirected-to pages
    I can see this would a quite a bit more work.
    And they seem fairly rare, so doing those manually isn't all that bad.
    Again, thanks for a useful tool.
    I'll update if I run across a relative-only example, in case you want to try that.

     
  • Ajith Antony
    Ajith Antony
    2012-02-11

    @philipphanes,

    That link, http://www.wyndhamrewards.com/, is probably not going to be possible
    for this project.  That page returns a bunch of javascript that tries to guess
    which international site to redirect you to.  It then uses the
    "location.replace()" method to perform the redirect.

    This is a *very* hard problem to solve.  The only complete solution would be to
    implement an entire browser with java script support to evaluate scripts like
    that.

    As for the relative links, that is fairly easy.  I'll prepare a fix and see if
    @luckyrat is interested.  Assuming the new github repo is up to date, it
    doesn't appear that he fixed that yet.