Code: Select all
img.src = "chrome://favicon/" + url_;
https://developer.mozilla.org/en-US/Add ... nsions/API
the permission is
Code: Select all
"chrome://favicon/"
and as far i read i cannot use the sdk api level:
https://developer.mozilla.org/en-US/Add ... 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:
https://developer.mozilla.org/en-US/Add ... Add-on_SDK
Low-level APIs
Add-on SDK WebExtensions
places/bookmarks bookmarks
places/favicon None
Update:
i just examined another (chrome+firefox) extension "group speed dial") which contains the request method
Code: Select all
https://plus.google.com/_/favicon?domain_url=${t}
Update2
plus.google is blocked due tracking protection and only root domain returns propper favicon (in most cases).
Code: Select all
img.src = 'https://s2.googleusercontent.com/s2/favicons?domain_url=' + 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;
},