You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it possible to desktop capture with cursor hidden? #7584
I need to capture the screen but not capturing the mouse pointer. I'm combining desktopCapture and getUserMedia APIs as explained in the docs to capture the video, but that's also capturing the cursor.
Can you point me out on what I need to do to remove the cursor from the MediaStream?
Thanks in advance!
Reacted by Mariano Converti, Zeke Sikelianos, Vlad Frolov, Matt Way, Ahmed Abdalla, rmnprt, Gustavo Garcia, Jesse Zhang, Steve Seguin, Jim Fisher and 6 more
Currently there is no way to do that, I suggest bringing this up at Chromium's issues list, Electron is just using Chromium for the desktop capture and we are not able to add this feature on Electron's side.
Reacted by Emanuel Vecchio, Vlad Frolov and Patrick Leiser
In case anyone needs this: I'm doing screenshot based testing for an electron app and I'm running this before taking a screenshot to remove the cursor,
// Remove cursor from page before taking a screenshotapp.webContents.executeJavaScript('setImmediate(function blur() { document.activeElement.blur(); })')
Activity
zcbenz commentedon Oct 24, 2016
Currently there is no way to do that, I suggest bringing this up at Chromium's issues list, Electron is just using Chromium for the desktop capture and we are not able to add this feature on Electron's side.
SimplyAhmazing commentedon Oct 11, 2017
In case anyone needs this: I'm doing screenshot based testing for an electron app and I'm running this before taking a screenshot to remove the cursor,
rmnprt commentedon Oct 1, 2018
@SimplyAhmazing That din't work for me, on Windows 10 at least. Is there any better way of doing this, one year down the line, with electron 3.x
CapOM commentedon Jul 5, 2019
In future https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints/cursor
always,motion,never, so you will be able to control cursor passing option to getUserMedia, see https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraintsemptycrown commentedon Feb 25, 2020
This is enabled? How do you incorporate other MediaTrackConstraints parameters into the desktopCapturer template from the docs?
munjalpatel commentedon Mar 30, 2020
I am also trying to figure that out. Can't find a good documentation for it anywhere.
CapOM commentedon Mar 30, 2020
Not yet implemented, tracking bug in chromium seems to be https://bugs.chromium.org/p/chromium/issues/detail?id=1007177
hackers365 commentedon Jun 3, 2021
any update?
danielehrhardt commentedon Jul 16, 2023
Can you implement:
https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings/cursor
alekye commentedon Jul 31, 2023
what about cursor now?
Merry9 commentedon Dec 15, 2023
我通过 C++ 提供的接口将鼠标指针隐藏了,但是截图 捕获的图像中还是包含了鼠标
我在想,是我调用接口的时机不对吗?但是我在用户点击截图按钮和系统开始捕获图像时都马上调用了函数并且等接口返回结果才开始进行下一步的
想不明白这里为啥不正常?