简体   繁体   中英

How to change Bookmarklet favicon in Opera?

我正在尝试给我的书签一个 favicon 以删除 Opera 上的默认黑星,我阅读了这篇旧文章这篇关于 stackoverflow 的帖子,我什至安装了这个 chrome 扩展程序,但在 Opera 浏览器上没有运气

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM