google-chrome-app - 使用 chrome.app.window.create 时如何截屏
问题描述
我创建了一个 chrome 应用程序并在 background.js 中打开一个新窗口,使用:
chrome.app.window.create
我想截取屏幕截图,但从我读过的内容来看,我需要使用:
chrome.tabs.captureVisibleTab
但 chrome.tabs 未定义
我有权限:
"tabs",
"activeTab"
如何截取屏幕截图?
解决方案
检查Manifest.json文件中的权限,它应该包含
在 chrome扩展中:使用chrome.tabs.captureVisibleTab。更多信息:captureVisibleTab 选项卡和activeTab
"permissions": [
"activeTab",
"tabs",
],
并在 chrome应用程序中:: 使用chrome.desktopCapture。更多信息:chrome.desktopCapture
"permissions": [
"desktopCapture",
],
推荐阅读
- python - 在 PyTorch 中指定 LSTM 层中的单元数
- php - 如何获取mysqli_fetch_array php中的第一个值
- google-cloud-firestore - 如果子集合中的文档被修改,事务会失败吗?
- php - PHP从没有直接图像名称的url下载图像
- python - 用 Python 绘制眼镜蛇图表
- php - AWS SES 电子邮件未使用 Laravel 验证
- python - Django - 注册失败,向用户显示原因
- azure-policy - 如何比较 Azure Policy 中的多个数组?
- java - 复制实例变量后出现空指针异常?
- javascript - 错误 [ERR_MODULE_NOT_FOUND]:找不到从 build\server.js 导入的模块 'build\app'