Skip to content

Commit f1cc385

Browse files
committed
Feature/141/permission handling (#145)
* (#141) Switch to using @nut-tree/node-mac-permissions for universal binaries to support both x64 and Apple Silicon * (#141) Change package import for @nut-tree/node-mac-permissions, adjust message for screen capture
1 parent 8c9ef36 commit f1cc385

File tree

3 files changed

+31
-40
lines changed

3 files changed

+31
-40
lines changed

Diff for: package-lock.json

+27-36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"node-addon-api": "5.0.0"
4141
},
4242
"optionalDependencies": {
43-
"node-mac-permissions": "2.2.1"
43+
"@nut-tree/node-mac-permissions": "2.2.1"
4444
},
4545
"engines": {
4646
"node": ">=10.15.3"

Diff for: permissionCheck.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const libnut = require("bindings")("libnut");
22

33
try {
4-
const permissions = require("node-mac-permissions");
4+
const permissions = require("@nut-tree/node-mac-permissions");
55

66
const wrapWithWarning = (message, nativeFunction) => (...args) => {
77
console.warn(message);
@@ -31,7 +31,7 @@ try {
3131
return nativeFunction;
3232
} else if (screenCaptureStatus === 'not determined' || screenCaptureStatus === 'denied') {
3333
permissions.askForScreenCaptureAccess();
34-
return wrapWithWarning(`##### WARNING! The application running this script tries to access accessibility features to execute ${functionName}! Please grant the requested access and visit https://github.com/nut-tree/nut.js#macos for further information. #####`, nativeFunction);
34+
return wrapWithWarning(`##### WARNING! The application running this script tries to screen recording features to execute ${functionName}! Please grant the requested access and visit https://github.com/nut-tree/nut.js#macos for further information. #####`, nativeFunction);
3535
}
3636
}
3737

@@ -70,4 +70,4 @@ try {
7070
console.warn(`Returning original module.`);
7171
} finally {
7272
module.exports = libnut;
73-
}
73+
}

0 commit comments

Comments
 (0)