javascript - 如何在谷歌浏览器扩展中引用版本信息?

标签 javascript json google-chrome google-chrome-extension

我用

chrome.tabs.create({url:"URL here"})

在我的 LRG 中打开一个新标签。我想在这个 URL 中附加扩展的版本号,它在 manifest.json 文件中指定:

"version": "1.2",

如何在创建新标签时获取 javascript 中的版本号?

最佳答案

在你的扩展中试试:

chrome.app.getDetails().version

不知道为什么不在other APIs里面但它适用于我的 Chrome 13 beta。而是在旧版本的 Chrome 中测试它:)。

编辑:It's probably a little buggy

关于javascript - 如何在谷歌浏览器扩展中引用版本信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6436039/

相关文章:

javascript - cordova firebase google 登录 - 登录错误!!错误 : The redirect operation has been cancelled by the user before finalizing

javascript - 即使 JSON 格式正确,Select2 也不显示 AJAX 结果

java - 如何将 POJO 转换为 JSON,反之亦然?

javascript - 如何在 Google Chrome 中关闭保留 JavaScript 控制台持久性

ruby - 未初始化的常量 Selenium::WebDriver::Chrome::Options (NameError)

javascript - 单击 Bootstrap 模式 anchor 时添加 URL 哈希

javascript - 显示对象的对象对象问题

javascript - 无法访问Web动态项目中的Angular JS页面

json - 使用 JSONEncoder 编码/解码符合协议(protocol)的类型数组

java - 在 Selenium 中以隐身模式运行 chrome 浏览器