Reliably getting favicons in Chrome extensions, chrome://favicon?

后端 未结 4 1791
生来不讨喜
生来不讨喜 2020-12-23 10:15

I\'m using the chrome://favicon/ in my Google Chrome extension to get the favicon for RSS feeds. What I do is get the base path of linked page, and append it to

4条回答
  •  臣服心动
    2020-12-23 10:29

    I inspected the website-icon in Chrome history page and found this simpler method. You can get the favicon url by --

    favIconURL = "chrome://favicon/size/16@1x/" + tab.url;
    

    Don't forget to add "permissions" and "content_security_policy" to Chrome. (https://stackoverflow.com/a/48304708/9586876)

提交回复
热议问题