【问题标题】:Chrome off-screen tab capture API, and extension whitelistingChrome 屏幕外标签捕获 API 和扩展白名单
【发布时间】:2017-11-04 05:59:32
【问题描述】:

我想在我的扩展程序中使用Chrome off-screen tab capture API。所以,我创建了一个带有tabCapture 权限的清单,以及一些代码来尝试一下:

chrome.tabCapture.captureOffscreenTab('http://example.com', {
  audio: true,
  video: true
}, function () {
  console.log(arguments);
});

很遗憾,我在控制台上收到此错误:

运行 tabCapture.captureOffscreenTab 时未检查 runtime.lastError:扩展未列入白名单,无法使用不稳定的、正在开发的 chrome.tabCapture.captureOffscreenTab API。

如何将我的扩展程序列入白名单?

我找到了一个 bug report,其中要求使用 _api_features.json 而不是硬编码的扩展 ID,但我找不到该文件。

【问题讨论】:

  • 只能在本地使用--whitelisted-extension-id=yourextensionid命令行开关将其列入白名单。
  • @wOxxOm 对我来说已经足够好了,反正我只是在试验。万分感谢!您应该将其发布为答案。
  • @wOxxOm BOOOOMSSHHaakalakalshakalaka

标签: google-chrome google-chrome-extension chromium


【解决方案1】:

@wOxxOm 回答了这个问题!

chrome://extensions 上获取扩展程序的 ID。像这样运行 Chrome:

chrome.exe --whitelisted-extension-id=abcdefghijklmnopqrstuvwxyz

效果很好!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    • 1970-01-01
    • 2017-03-15
    • 1970-01-01
    相关资源
    最近更新 更多