Chrome 扩展程序:创建的选项卡上的 URL 栏为空
目前,我正在开发一个 Chrome 扩展程序,到目前为止很有趣,但现在我遇到了一个小问题。
一般来说,包含插件文件的选项卡有一个空的 URL 栏(我使用的是 Chrome 13.xx),如以下屏幕截图所示:
此选项卡是通过以下代码创建的:
chrome.tabs.create({
url: chrome.extension.getURL('../relative/path/to/a/file.html')
}, function(newTab){
...
});
如果 URL 可见,那就太好了,这样就可以与安装了相同扩展程序的其他人共享(URL 有一个唯一的 ID)对于延期,如果我不是错误)
Currently, I'm working on an extension for Chrome, which is great fun so far, but now I encountered a little problem.
Generally, tabs that contain a file of the plugin have an empty URL bar (I'm using Chrome 13.xx), like shown in this screenshot:
This tab was created by the following code:
chrome.tabs.create({
url: chrome.extension.getURL('../relative/path/to/a/file.html')
}, function(newTab){
...
});
It would be nice to have the URL visible, so it can be shared with other people who have the same extension installed (the URL has a unique ID for the extension, if I'm not mistaken)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为暂时不可能。请参阅 Chromium 的问题 72021:
http://code.google.com/p /chromium/issues/detail?id=72021
您可能只想在页面上的某个位置包含 URL 并方便用户复制(例如
框不会比 URL 栏本身更具侵入性)。
I don't believe it's possible for the time being. See issue 72021 for Chromium:
http://code.google.com/p/chromium/issues/detail?id=72021
You might just want to include the URL somewhere on the page and make it easy to copy for users (e.g. an
<input type="text">
box wouldn't be much more intrusive than the URL bar itself).