Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

active-win requires the screen recording permission error #150

Open
david-george-axomic opened this issue Oct 26, 2022 · 2 comments
Open

Comments

@david-george-axomic
Copy link

david-george-axomic commented Oct 26, 2022

When trying to run activeWindow() on macos m1 arm64, I am getting this error "active-win requires the screen recording permission in “System Preferences". I don't get any prompt to give the screen recording permission either, any idea whats wrong.

Error: Command failed: /Users/davidgeorge/Documents/GitHub/oa-assetsbar-v2/node_modules/active-win/main
    at ChildProcess.exithandler (node:child_process:397:12)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Socket.<anonymous> (node:internal/child_process:450:11)
    at Socket.emit (node:events:390:28)
    at Pipe.<anonymous> (node:net:687:12) {
  killed: false,
  code: 1,
  signal: null,
  cmd: '/Users/davidgeorge/Documents/GitHub/oa-assetsbar-v2/node_modules/active-win/main',
  stdout: 'active-win requires the screen recording permission in “System Preferences › Security & Privacy › Privacy › Screen Recording”.\n',
  stderr: ''

I'm only trying to run the sample file

const activeWindow = require("active-win");

(async () => {
  console.log(await activeWindow());
  /*
	{
		title: 'Unicorns - Google Search',
		id: 5762,
		bounds: {
			x: 0,
			y: 0,
			height: 900,
			width: 1440
		},
		owner: {
			name: 'Google Chrome',
			processId: 310,
			bundleId: 'com.google.Chrome',
			path: '/Applications/Google Chrome.app'
		},
		url: 'https://sindresorhus.com/unicorn',
		memoryUsage: 11015432
	}
	*/
})();
@apipaliya
Copy link

apipaliya commented Dec 2, 2022

@david-george-axomic Use active-win v5.1.3

@tom2strobl
Copy link

It used to be only accessibility permissions, now its screen recording as well but in the docs it says only screen recording permissions, but active-win requesting it is pretty flaky and sometimes doesn't happen, sometimes it does, but then the modal is somewhere buried between other windows, it's kinda weird right now. Especially since users are really hesitant to giving screen recording permission nowadays.

@apipaliya it's interesting that the older version did not require the permissions, which seems like quite the regression. We can agree that staying on a very old version is not really the right step into the future.

I'm curious why the old version worked fine and the new requires more permissions 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants