我正在编写一个 chrome 扩展程序,我想截取运行该扩展程序的选项卡的屏幕截图。扩展程序网址类似于“chrome-extension://abcde”。如果我包含“tabs”和“>”,一切正常在我的权限列表中,但我真的不想要求 >允许。
我尝试将“chrome-extension://abcde”添加到权限中,而不是 >我收到错误“您无权使用‘tabs.captureVisibleTab’。请务必在清单中声明您需要哪些权限。”
我该如何解决这个问题?
I'm writing a chrome extension and I want to take a screenshot of the tab in which the extension is running. The extension url is like "chrome-extension://abcde". Everything works if I include "tabs" and "<all_urls
>" in my list of permissions, but I don't really want to ask for the <all_urls
> permission.
I tried adding "chrome-extension://abcde" to permissions instead of <all_urls
> and I get the error "You do not have permission to use 'tabs.captureVisibleTab'. Be sure to declare in your manifest what permissions you need."
How can I solve this?
发布评论
评论(1)
您应该在权限中指定您希望能够捕获的主机。现在您已将其设置为您自己的扩展 ID,因此它可能无法正常工作。
http://code.google.com/chrome/extensions/tabs.html
You should specify the hosts you want to be able to capture in the permissions. Now you've set it to your own Extension ID so that's why it's probably not working.
http://code.google.com/chrome/extensions/tabs.html