5

We have 'abc.com' and users have their own page with 'abc.com/userid'

Users set favicon for thier page, and published.

But some browsers(iOS Safari) replace all favicons in bookmarks which already exist

This is step:

  1. I add bookmark 'abc.com/user1' with favicon 'user1.png'
  2. I add bookmark 'abc.com/user2' with favicon 'user2.png'
  3. Both bookmark image are same 'user2.png'

I can't find spec about it. I want to know whether favicon is unique for domain or not

Thanks

Minsu
  • 141
  • 8
  • 1
    Interesting issue. Could you edit your question to indicate how you declare the icons? (ie. the HTML line(s) in both pages) – philippe_b Sep 20 '18 at 04:53
  • @philippe_b - I am running into the same issue as the question author. I am dynamically adding the apple-touch-icon via javascript based on the path. So in the authors example: 'abc.com/user1' I am adding the icon like this: ``. This does not work correctly on an iPad (intended target) but it does work correctly in Chrome if I change the the rel to `rel='shortcut icon`. Any guidance would be greatly appreciated – Jason Nov 19 '18 at 13:55
  • @Jason Your code is missing in your comment. – philippe_b Nov 19 '18 at 18:05
  • @philippe_b - this is the javascript code I am using:
    `document.title = this.storeState.business.name;
    document.head || (document.head = document.getElementsByTagName('head')[0]);
    var link = document.createElement('link');
    link.rel = 'apple-touch-icon';
    link.href = '/images/icons/' + this.storeState.business.faviconUrl;
    document.head.appendChild(link);`
    – Jason Nov 20 '18 at 04:27
  • apologies for no line breaks, having a tough time formatting this one - pls ignore the line break tags... – Jason Nov 20 '18 at 04:28
  • 1
    I never played with favicon and JS, so I'm of little help here. First thing I would do: look for existing reference to find out if this really works or not. I wouldn't be surprised if that wouldn't work, even if everything is okay regarding DOM. – philippe_b Nov 20 '18 at 08:03
  • 1
    @philippe_b - after much research and trying a lot of different things, I don't think it is possible to create a dynamically changing apple-touch-icon via javascript. I was midway through posting my research / what I have tried as the answer but then I realized that isn't even the question Minsu was asking :/ If you should happen to stumble across a solution for dynamically changing apple-touch-icons in the future, please do let me know. Thanks! – Jason Nov 21 '18 at 02:53
  • I'm sorry it didn't work in the end. If I learn anything I'll post it here. – philippe_b Nov 21 '18 at 10:33

0 Answers0