![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@fttx/mac-screen-capture-permissions
Advanced tools
Check and request permission to capture the screen
Check and request permission to capture the screen on macOS (introduced with 10.15 Catalina)
$ npm install mac-screen-capture-permissions
See example.js for usage.
const {
hasScreenCapturePermission,
hasPromptedForPermission
} = require('mac-screen-capture-permissions');
hasPromptedForPermission();
// false
hasScreenCapturePermission();
// false
hasPromptedForPermission();
// true
// After accepting the permissions
hasScreenCapturePermission();
// true
.hasScreenCapturePermission(): boolean
Whether or not the current app has the required permissions to record the screen. If this is the first time attempting, a permissions dialog will be shown to the user. Any subsequent calls to hasScreenCapturePermission
will just check for the permission but won't show a dialog. If the user denied the original request, you need to prompt them to enable the permissions in the System Preferences.
This can be reset by calling resetPermissions
. The dialog will be shown again after that.
Returns true
on macOS versions older than 10.15 since this permission wasn't present
.hasPromptedForPermission(): boolean
Note: Only works for Electron apps
Whether or not the permission dialog has been shown to the user. Will be false
if you haven't called hasScreenCapturePermission
for this app yet, and true
otherwise.
This can be reset by calling resetPermissions
,
Returns false
on macOS versions older than 10.15 since this permission wasn't present
.resetPermissions({bundleId?: string}): boolean
Reset the ScreenCapture
permissions. It will reset the permissions for all apps, so use with care. Provide a bundleId
(i.e. com.apple.Terminal) to reset the permissions only for that app.
Calls tccutil reset ScreenCapture [bundleId]
.
This will revoke access if it was previously granted, and it will trigger the permissions dialog the next time hasScreenCapturePermission
is called.
Returns true
if the command executed successfully and false
otherwise.
Returns false
on macOS versions older than 10.15 since this permission wasn't present
.openSystemPreferences(): Promise<void>
Open the System Preferences in the Screen Recording permissions section under the Security pane.
Only available in Electron apps.
Returns a Promise that resolves when the window is opened
MIT
FAQs
Check and request permission to capture the screen
The npm package @fttx/mac-screen-capture-permissions receives a total of 0 weekly downloads. As such, @fttx/mac-screen-capture-permissions popularity was classified as not popular.
We found that @fttx/mac-screen-capture-permissions demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.