如何使用chrome扩展名更改当前选项卡的标题 [英] How to alter title of present tab using chrome extension
问题描述
我想使用扩展名来更改标签的标题。实际上,我使用了
chrome.tabs.get(function(tabs){。 ..
如何使用上述函数?
是否有另一种方式可以直接更改标题?
document.title = 我的真棒标题!
有关详细信息,请查看内容脚本文档: http://code.google.com/chrome/extensions/content_scripts.html
I would like to change the title of a tab using extension.Actually i got stuck up at using
chrome.tabs.get(function(tabs){...
How to use the above function? is there another way i can directly change the title?
The title isn't a property of the tab, but of the page inside the tab. Adjusting a page's title, however, is certainly possible: one mechanism would be to inject a content script that effected document.title
:
document.title = "My awesome title!"
For details, take a look at the content script documentation: http://code.google.com/chrome/extensions/content_scripts.html
这篇关于如何使用chrome扩展名更改当前选项卡的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!