Bug 243722 - cannot update favicon from database config by javascript in safari private mode
Summary: cannot update favicon from database config by javascript in safari private mode
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Website (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad All
: P3 Normal
Assignee: Nobody
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks:
 
Reported: 2022-08-09 01:13 PDT by le ngoc trung
Modified: 2022-08-16 15:38 PDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description le ngoc trung 2022-08-09 01:13:14 PDT
I have a website (reactjs code).
Last year, my site's favicon is only one. And I setting favicon by <link rel="icon" type="image/x-icon" href="/images/favicon.ico"> in head tag.

Then my user want to add favicon and title config from database.

In index.js file,  app will call api getFavicon, and then update favicon using bellow code.

var link = document.querySelector("link[rel~='icon']");
if (!link) {
    link = document.createElement('link');
    link.rel = 'icon';
    document.getElementsByTagName('head')[0].appendChild(link);
}
link.href = faviconFromApi;


After we update favicon from database
All browser work fine. But only in safari private mode, favicon is not change. it still display the old favicon we added last year.

We try to remove cache and test again but it still not change. But if we use safari normal mode, it work fine (favicon will change exactly).

Then I try to another way. remove cache and restart our iphones.
And the results are, in private mode, ios 15.6 and ios 15.1, the favicon update successully. But only ios 15.5 it still not work.

Please help me to fix it. How to make favicon in safari private mode change like what is safari normal mode work.
Comment 1 Radar WebKit Bug Importer 2022-08-16 01:14:19 PDT
<rdar://problem/98711129>
Comment 2 Smoley 2022-08-16 15:38:13 PDT
I think the fix for this will likely be in a Safari component rather than WebKit. Please reproduce the issue, note the time of occurrence and file feedback containing a sysdiagnose via http://feedbackassistant.apple.com. Thanks.