Retrieve/Refresh Bookmark Icons, Favicons?

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
Splat
Moonbather
Moonbather
Posts: 56
Joined: 2014-07-04, 06:51
Location: USA

Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by Splat » 2019-04-19, 23:26

I know visiting each bookmarked site will do this but is there an en-masse way to retrieve/refresh all favicons? I won't get into why I need to do this, that's irrelevant here, but I've got about 200-250 bookmarks that I need their icons back. Thanks.

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by coffeebreak » 2019-04-20, 02:50

You might try the extension FavIcon Reloader (version 0.8.1-signed).
(have not had occasion to use it myself, but I've seen it recommended by others.)

It can be found in either of the xul extension archives:

van p
Astronaut
Astronaut
Posts: 595
Joined: 2015-11-19, 07:15
Location: Cincinnati, OH, U.S.A.

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by van p » 2019-04-21, 22:04

I tried using FavIcon Reloader 2-3 years ago for (I believe) Waterfox, and it did nothing. If it works for somebody else, great.
Windows 10 Pro x64 v22H2 8GB i5-4570|Pale Moon v33.0.2 x64

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by coffeebreak » 2019-04-22, 00:35

van p wrote:
2019-04-21, 22:04

I tried using FavIcon Reloader 2-3 years ago for (I believe) Waterfox, and it did nothing.
Did the version of Waterfox you used have E10S enabled ?

The Favicon Reloader entries in Classic Add-ons Archive and LegacyCollector say it doesn't work with E10S enabled, so: not in a Firefox releasef later that 48, nor in Firefox forks based on post-48 if E10S is enabled.

van p
Astronaut
Astronaut
Posts: 595
Joined: 2015-11-19, 07:15
Location: Cincinnati, OH, U.S.A.

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by van p » 2019-04-22, 04:06

coffeebreak wrote:
2019-04-22, 00:35
van p wrote:
2019-04-21, 22:04

I tried using FavIcon Reloader 2-3 years ago for (I believe) Waterfox, and it did nothing.
Did the version of Waterfox you used have E10S enabled ?

The Favicon Reloader entries in Classic Add-ons Archive and LegacyCollector say it doesn't work with E10S enabled, so: not in a Firefox releasef later that 48, nor in Firefox forks based on post-48 if E10S is enabled.
Don't know if E10S was even an issue in Waterfox at the time, but if it was there I doubt it was enabled (somebody might be able to prove me wrong, though; I don't know).
Windows 10 Pro x64 v22H2 8GB i5-4570|Pale Moon v33.0.2 x64

coffeebreak
Moon Magic practitioner
Moon Magic practitioner
Posts: 2986
Joined: 2015-09-26, 04:51
Location: U.S.

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by coffeebreak » 2019-04-22, 10:41

Off-topic:
van p wrote:
2019-04-22, 04:06
Don't know if E10S was even an issue in Waterfox at the time, but if it was there I doubt it was enabled
It's at least within the realm of possibility.
Waterfox enabled E10S by default with the release of version 56.0 (Nov 30, 2017) and offered it as a user preference somewhat earlier, since 55.1. Their GitHub repository has a quantity of issues concerning E10S.


Though I don't know if it's guaranteed to help, personally I think it's worth trying Favicon Reloader.

User avatar
jars_
Lunatic
Lunatic
Posts: 398
Joined: 2016-12-27, 00:12

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by jars_ » 2019-04-22, 11:16

CustomButtons [fixed6] + button [CB]Restore all bookmark icons

Code: Select all

// Добавить новый пункт "Восстановить иконки всех закладок" в меню "Закладки", от 04.10.2016. ..............
(()=> {
   // Создать новый пункт в меню "Закладки" ....
   // Create new menuitem in Bookmarks menu
   var menuitem = document.createElement("menuitem");
   var sep = document.getElementById("organizeBookmarksSeparator");
   sep.parentNode.insertBefore(menuitem, sep);   
   menuitem.setAttribute("label", "Восстановить иконки всех закладок");
   menuitem.onclick =e=> chooseBookmarks();    
   addDestructor(()=> menuitem.remove());


   // Перебрать все http(s) закладки ....
   function chooseBookmarks(id = 1) {
      var folder = PlacesUtils.getFolderContents(id).root;
   
      folder.QueryInterface(Ci.nsINavHistoryContainerResultNode);
      folder.containerOpen = true;

      for ( var i = 0; i < folder.childCount; i++ ) {
            var child = folder.getChild(i);
   
            PlacesUtils.nodeIsFolder(child)
            ? chooseBookmarks(child.itemId)
            : child.uri.startsWith("http") && child.icon == '' && getSiteFavicon(child.uri);
            }
                       
      folder.containerOpen = false;
   };


   // Добавить иконки к закладкам с одинаковыми адресами ....  
   function setBookFavicon(siteURI, faviconURI) {
      var iconURI = Services.io.newURI( faviconURI, null, null);
      var bookmarkURI = Services.io.newURI( siteURI, null, null );
           
      PlacesUtils.favicons.setAndFetchFaviconForPage(
         bookmarkURI,
         iconURI,
         false,
         this.FAVICON_LOAD_NON_PRIVATE,
         null,
         Services.scriptSecurityManager.getSystemPrincipal()
      )
   };
   
   
   // Получить адрес иконки закладки и запустить установку иконки .... 
   function getSiteFavicon(siteURI) {
      var hostURI = "http://" + siteURI.split(/\/+/g)[1] + "/";
      var faviconURI = hostURI + "favicon.ico";  // адрес иконки, если не получить адрес иконки из сайта
      
      // получить адрес иконки из документа сайта закладки
      var xhr = new XMLHttpRequest();
      xhr.open("GET", siteURI, true);
      xhr.responseType = "document";      
      xhr.onload = xhr.onerror =()=> {
         var doc = xhr.responseXML;
         if ( doc !== null ) {
              var links = doc.getElementsByTagName("link");
              [...links].forEach(link=> {
                 if ( /(?:^|\s)icon(?:\s|$)/.test(link.rel.toLowerCase()) ) faviconURI = link.href });
              }
                         
         setBookFavicon(siteURI, faviconURI);  // запустить установку иконки   
      }
      xhr.send();
   };   
     
})();


User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2409
Joined: 2012-08-19, 20:32

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by back2themoon » 2019-04-22, 13:57

Favicon Reloader does not work with Pale Moon 28, this has been discussed in the past and you can stop trying. The suggestion from jars_ looks interesting, haven't tried it.

(update: I installed the extension, but not sure how to create a working button)

User avatar
jars_
Lunatic
Lunatic
Posts: 398
Joined: 2016-12-27, 00:12

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by jars_ » 2019-04-22, 15:43

not sure how to create a working button
1. RMClick on panel -> Add New Button -> Appears window with tabs
2. copy code (Код)
custombutton://%3C%3Fxml%20version%.....................................--> to the end
3. paste it "URL button" (top line)
4. OK

then click the created button. High CPU loads, take some time(i have 3000+ bookmarks)... it is better to leave browser alone, but it works.

User avatar
back2themoon
Moon Magic practitioner
Moon Magic practitioner
Posts: 2409
Joined: 2012-08-19, 20:32

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by back2themoon » 2019-04-22, 15:58

Thanks. A huge button was created (5x the normal size), but it worked. :thumbup:

User avatar
jars_
Lunatic
Lunatic
Posts: 398
Joined: 2016-12-27, 00:12

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by jars_ » 2019-04-22, 16:23

Yes :) the button icon is too big. replace it with smaller. I forget it ....
Paste it in 3-rd line "Image":
[ base64-code icon for button ]

Code: Select all

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAATCAYAAACQjC21AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEMklEQVQ4y5WUTWyUZRDH//M8z7vb/exud7dbLBS3FNoiLQTEVCQaQz1UBAIIUo0REoNRbiLIDbwoaKIHLyYGD5qQKMEPih8BlWBIoBCikJoCyyKUYkrb7W6Xvt2v93nGw7aFC0bnOJP5JTPznz/wwCAAEBAWsOHQCWw41AOhKrl/iQcXSUgABolVK911rZ2uupbVSHQuB2BAUvx/IGuGtIBF3bvi0WrEwkHCI907IS2ANf13IBEglAJg8HDnyqrZi9f6LWa/i2HVL3oeic5HAWgIaYGIplZzH1BICSEVSCiQkGAQjGMgLGDhCztr4zG4grXGCtbpSKxOYmH3mxAKMFqDGSCSIKEg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GY6+/eD/jH1rhvt7Dj7lgAAAAAElFTkSuQmCC

Goodydino
Keeps coming back
Keeps coming back
Posts: 827
Joined: 2017-10-10, 21:20

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by Goodydino » 2019-04-22, 21:27

CheckPlaces is an extension that can check bookmarks, and it can also reload favicons. It still works with Pale Moon. It is here:
http://daniel-lange.com/archives/71-Syn ... d-ons.html

Splat
Moonbather
Moonbather
Posts: 56
Joined: 2014-07-04, 06:51
Location: USA

Re: Retrieve/Refresh Bookmark Icons, Favicons?

Unread post by Splat » 2019-04-26, 01:35

Just tried latest Checkplaces and it didn't retrieve my missing favicons. Thanks guys.

Locked