3

I'm trying to give my bookmarklet a favicon to remove that default black star on Opera, I read this old article, this post on stackoverflow and I even installed this chrome extension with no luck for Opera browser

1 Answers1

0

I am not sure about how exactly Opera works different from Chrome. I just hope to give you this Bookmarklet and hopefully it works:

javascript:(function(bookmarklets){
  for(var i=0;i<bookmarklets.length;i++){
    var code=bookmarklets[i].url;
    if(code.indexOf("javascript:")!=-1){
      code=code.replace("javascript:","");
      eval(code)
    }else{
      code=code.replace(/^s+|s+$/g,"");
      if(code.length>0){window.open(code)}
    }
  }
})
([{title:" ",url:"javascript:(function(){var link = document.querySelector(\x22link[rel~=\x27icon\x27]\x22);if (!link) {link = document.createElement(\x27link\x27);link.rel = \x27icon\x27;document.getElementsByTagName(\x27head\x27)[0].appendChild(link);}link.href = \x22https://google.com/favicon.ico\x22 })()"},{title:" ",url:"javascript:(function(){var title= 'Insert Text' ;document.title=title})();"}])

It changes the Favicon to the Google favicon and it changes the text of the tab.

Edit: I read the Question Wrong!! and you cant change a Bookmarks Icon.

  • I think that your code isn't what I needed: i would like to give the bookmarklet itself a favicon so I can recognize it better in the favorites bar rather than having to read the title I gave it – Michele Galliano Dec 07 '21 at 11:10
  • OH, well you cant change a Icon of a Bookmark/Bookmarklet, because this is automaticaly done. If you have truble finding your Bookmarklet then i recommend you [this](https://chrome.google.com/webstore/detail/powerlet/ofecodkcadbenmiknnidnfepbblapgkn?ucbcb=1) Extension. The Extension Searches every Bookmarklet you have and lets you use a Search Box to find them.@MicheleGalliano – I know Stuff Jan 05 '22 at 10:06