dynamically modify the tab icon not work in the browser of Apple device.

%3CLINGO-SUB%20id%3D%22lingo-sub-2248865%22%20slang%3D%22en-US%22%3Edynamically%20modify%20the%20tab%20icon%20not%20work%20in%20the%20browser%20of%20Apple%20device.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2248865%22%20slang%3D%22en-US%22%3E%3CDIV%3E%3CDIV%20class%3D%22trans-left%22%3E%3CDIV%20class%3D%22trans-input-wrap%22%3E%3CDIV%20class%3D%22input-wrap%22%3E%3CDIV%20class%3D%22input-operate%22%3E%3CDIV%20class%3D%22op-favor-container%22%3EWe%20want%20to%20dynamically%20modify%20the%20tab%20icon%20in%20the%20extension%20of%20SharePoint%20online.%20The%20code%20is%20as%20follows.%3CDIV%20class%3D%22trans-right%22%3E%3CDIV%20class%3D%22output-wrap%20small-font%22%3E%3CDIV%20class%3D%22output-mod%20ordinary-wrap%22%3E%3CDIV%20class%3D%22output-bd%22%3E%3CP%20class%3D%22ordinary-output%20target-output%20clearfix%22%3E%3CSPAN%20class%3D%22%22%3EThis%20function%20only%20doesn't%20work%20in%20the%20browser%20of%20Apple%20device.%3CSPAN%20class%3D%22%22%3E%3CSPAN%3E%26nbsp%3BI%20should%20make%20this%20function%20work%20in%20the%20browser%20of%20Apple%20device.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%20class%3D%22ordinary-output%20target-output%20clearfix%22%3EWe%20passed%20the%20static%20web%20page%20test%2C%20and%20this%20part%20of%20the%20code%20works%20in%20the%20Apple%20device.%20However%2C%20dynamic%20modification%20of%20SharePoint%20online%20cannot%20take%20effect.%3C%2FP%3E%3CP%20class%3D%22ordinary-output%20target-output%20clearfix%22%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CSPAN%3E%3CSPAN%3ECode%3A%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Evar%26nbsp%3Blink%26nbsp%3B%3D%26nbsp%3Bdocument.querySelector(%22link%5Brel*%3D'icon'%5D%22)%26nbsp%3Bas%26nbsp%3BHTMLElement%26nbsp%3B%7C%7C%26nbsp%3Bdocument.createElement('link')%26nbsp%3Bas%26nbsp%3BHTMLElement%3B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Blink.setAttribute('type'%2C%26nbsp%3B'image%2Fx-icon')%3B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Blink.setAttribute('rel'%2C%26nbsp%3B'shortcut%26nbsp%3Bicon')%3B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Blink.setAttribute('href'%2C%26nbsp%3Burl)%3B%0A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3Bdocument.getElementsByTagName('head')%5B0%5D.appendChild(link)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor
We want to dynamically modify the tab icon in the extension of SharePoint online. The code is as follows.

This function only doesn't work in the browser of Apple device. I should make this function work in the browser of Apple device.

We passed the static web page test, and this part of the code works in the Apple device. However, dynamic modification of SharePoint online cannot take effect.

 

Code: 

 

var link = document.querySelector("link[rel*='icon']") as HTMLElement || document.createElement('link') as HTMLElement;
      link.setAttribute('type', 'image/x-icon');
      link.setAttribute('rel', 'shortcut icon');
      link.setAttribute('href', url);
      document.getElementsByTagName('head')[0].appendChild(link);

 

0 Replies