Skip to content

Feature/141/permission handling #145

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

Merged
merged 2 commits into from
Nov 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 27 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"node-addon-api": "5.0.0"
},
"optionalDependencies": {
"node-mac-permissions": "2.2.1"
"@nut-tree/node-mac-permissions": "2.2.1"
},
"engines": {
"node": ">=10.15.3"
Expand Down
6 changes: 3 additions & 3 deletions permissionCheck.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const libnut = require("bindings")("libnut");

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

const wrapWithWarning = (message, nativeFunction) => (...args) => {
console.warn(message);
Expand Down Expand Up @@ -31,7 +31,7 @@ try {
return nativeFunction;
} else if (screenCaptureStatus === 'not determined' || screenCaptureStatus === 'denied') {
permissions.askForScreenCaptureAccess();
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);
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);
}
}

Expand Down Expand Up @@ -70,4 +70,4 @@ try {
console.warn(`Returning original module.`);
} finally {
module.exports = libnut;
}
}