chrome.desktopCapture在“标签”上抛出错误作为DesktopCaptureSourceType [英] chrome.desktopCapture throws an error on "tab" as DesktopCaptureSourceType

查看:272
本文介绍了chrome.desktopCapture在“标签”上抛出错误作为DesktopCaptureSourceType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Chrome扩展程序,我的要点是要记录一个浏览器选项卡,如 Screencastify Chrome扩展记录浏览器选项卡。我引用了 desktopCapture ,这是一个适用于屏幕和窗口作为DesktopCaptureSourceType的完美Chrome API,而对于Tab作为DesktopCaptureSourceType,它会引发错误:


desktopCapture.chooseDesktopMedia:标签捕获尚不受支持。


我在扩展的manifest.json中配置了所需的权限。任何人都可以为我提供一个解决方案吗?



PS:我只需要记录铬浏览器选项卡,不要求屏幕或窗口记录

解决方案

这是一个已知问题: https:// crbug .com / 488262



然而,您可以使用 chrome.tabCapture api。缺点是你必须在捕获标签和屏幕/窗口之间拆分你的界面,因为chrome.tabCapture没有提供相应的选择器。



为什么Google有两个独立的屏幕捕捉apis?好问题。

I am developing a chrome extension, and my point here is to record a browser tab , like Screencastify chrome extension records the browser tab. I referred desktopCapture , a chrome API which works perfectly for "screen" and "window" as DesktopCaptureSourceType, whereas for "tab" as DesktopCaptureSourceType, it throws an error as

desktopCapture.chooseDesktopMedia: Tab capture is not supported yet.

I have configured the required permissions in manifest.json of my extension. Could anyone suggest me a solution?

P.S : I need to record the chrome browser tab only, am not asking for a screen or window recording

解决方案

This is a known issue: https://crbug.com/488262

However, you can use the chrome.tabCapture api instead. The downside is that you will have to split your interface between capturing tabs and screens/windows, as chrome.tabCapture doesn't provide an equivalent picker.

Why does Google have two separate screen capture apis? Good question.

这篇关于chrome.desktopCapture在“标签”上抛出错误作为DesktopCaptureSourceType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆