如何使用chrome扩展名更改当前选项卡的标题 [英] How to alter title of present tab using chrome extension

查看:126
本文介绍了如何使用chrome扩展名更改当前选项卡的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用扩展名来更改标签的标题。实际上,我使用了

chrome.tabs.get(function(tabs){。 ..

如何使用上述函数?
是否有另一种方式可以直接更改标题?

document.title 的内容脚本:

  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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆