你可以使用Greasemonkey来做到这一点。在这里,您有一个可以工作的快速脚本。
//create the icon
a=document.createElement("link");
a.setAttribute("rel", "icon");
a.setAttribute("href","http://www.google.com/favicon.ico");
//append the icon to the head
document.documentElement.firstChild.appendChild(a);
Greasemonkey 的手册:(添加脚本)
如果您尝试更改其网站图标的站点已经有一个,您将不得不执行类似的操作
// get the head elements
head = document.documentElement.firstElementChild.childNodes;
//delete the existing favicon
for(i in head){
if((head[i].rel == "shortcut icon")||(head[i].rel == "icon")){
head.removeChild(head[i]);
}
}
在设置新的图标之前,但我无法让它工作。
有一个项目可以为网站图标操作创建一个标准对象,该对象应该可以工作,但对我不起作用。