webextension get favicon from bookmark [solved for now]

Talk about add-ons and extension development.
Posts: 3147
Joined: March 19th, 2005, 10:51 am

Post Posted September 2nd, 2017, 4:40 am

this is what i need to replace:
Code: Select all
img.src = "chrome://favicon/" + url_;

but i did not found yet any how-to on MDN ... nsions/API
the permission is
Code: Select all

but firefox dont support this, neither a replacement.
and as far i read i cannot use the sdk api level: ... es_favicon

converted extension is working that far but show no icons

any help appreciated, either link or a code snippet.
edit - maybe solved for now - there exist no replacement for sdk getfavicon: ... Add-on_SDK
Low-level APIs

Add-on SDK WebExtensions
places/bookmarks bookmarks
places/favicon None


i just examined another (chrome+firefox) extension "group speed dial") which contains the request method
Code: Select all${t}

which tries to get the favicon online.

Update2 is blocked due tracking protection and only root domain returns propper favicon (in most cases).
Code: Select all
        img.src = '' + extractHostname(url);

Code: Select all
   extractHostname(url) {
      var hostname;
      //find & remove protocol (http, ftp, etc.) and get hostname

      if (url.indexOf("://") > -1) {
         hostname = url.split('/')[2];
      else {
         hostname = url.split('/')[0];

      //find & remove port number
      hostname = hostname.split(':')[0];
      //find & remove "?"
      hostname = hostname.split('?')[0];

      return hostname;

Return to Extension Development

Who is online

Users browsing this forum: No registered users and 1 guest