Comments (5)
Not an elegant way, but I achieved it using another package
macos-accessibility-permissions
mac-screen-capture-permissions
from node-mac-permissions.
@Srini-B @theogravity does #60 address your issue?
Unfortunately the ergonomics aren't great for forcing the pref pane since it's kind of impossible to check in a clean way whether access has been denied previously or not yet queried, so i ended up adding a bool param to the request method. If that serves both of your needs well i can go ahead and merge it!
from node-mac-permissions.
Same here, @Srini-B any ideas?
from node-mac-permissions.
I didn't have any success with those recommended packages on the latest electron version 23
and MacOS Ventura.
I was able to get the pane to open by using the following:
import { execSync } from 'child_process';
import { isMacOSVersionGreaterThanOrEqualTo } from 'macos-version';
import { systemPreferences } from 'electron';
import { askForScreenCaptureAccess } from 'node-mac-permissions';
// initial prompt
askForScreenCaptureAccess();
const status = systemPreferences.getMediaAccessStatus('screen');
// user denied prompt, open up the pane for them to do it then
if (status === 'denied' && isMacOSVersionGreaterThanOrEqualTo('10.16')) {
try {
execSync('open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"');
} catch (e) {
console.log(e)
}
}
from node-mac-permissions.
Actually it's how one of the other packages does it too. I'm ok with that! Thanks for that PR!
from node-mac-permissions.
Related Issues (20)
- Unable to build on M1 mac HOT 1
- Error: incompatible architecture issue while run the application HOT 7
- Incompatible architecture issue while run the application in MAC M2 Chip HOT 1
- askForInputMonitoringAccess is not included on npm install HOT 3
- Module not found: Error: Can't resolve 'fs' HOT 2
- Language
- Can I use this on Google Chrome? HOT 2
- Full Disk Access always return unauthorised on MacOS Ventura HOT 5
- Missing Input monitoring permission HOT 1
- [BUG] Requesting accessibility permission in Electron program is always denied. HOT 3
- installing Problem with node-gyp and installing issue facing from internal dependency "Binding" HOT 2
- Support for cross platform projects HOT 3
- Proposal to support Automation permissions HOT 2
- Universal Binary Doesn't Work
- Incorrect type definitions for askForScreenCaptureAccess HOT 1
- Folder access automatically denied on signed app HOT 6
- Contacts permissions not popping
- app that was built in macOS 14.5.2(intel silicon) crashes in macOS 11.x
- Calendar & Reminder Access changes in Sonoma HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-mac-permissions.