-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Avoid triggering access dialogs on macOS #67
Conversation
Sounds useful, but it needs to be documented in the readme and index.d.ts. |
@@ -1,4 +1,21 @@ | |||
declare namespace activeWin { | |||
interface Options { | |||
/** | |||
Disable Accessibility permission check (macOS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs text should be in sync with the readme text.
I think each option should also describe what the effect of disabling it is, for example, the window title not being available.
/** | ||
Disable Accessibility permission check (macOS) | ||
*/ | ||
accessibilityCheck: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accessibilityCheck: boolean; | |
readonly accessibilityCheck: boolean; |
const result = activeWin.sync({ | ||
accessibilityCheck: false, | ||
screenRecordingCheck: false, | ||
url: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url: false, | |
url: false |
@@ -2,9 +2,14 @@ import {expectType, expectError} from 'tsd'; | |||
import activeWin = require('.'); | |||
import {Result, LinuxResult, MacOSResult, WindowsResult} from '.'; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -47,11 +47,17 @@ const activeWin = require('active-win'); | |||
|
|||
### activeWin() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### activeWin() | |
### activeWin(options?) |
@drslump Friendly bump :) |
@drslump Bump |
@sindresorhus Why would you just close this PR and leave the issue open? It looks like it was a good work in progress. Wouldn't it make sense to touch up the PR in the ways you recommend and merge this in? |
Recent macOS versions the operating system is triggering accessibility dialogs asking the user if an operation should be allowed. Our application tries to guide the user through it as part of our onboarding setup.
So it'll be great if we can instruct active-win to skip functionality that would trigger those dialogs. For instance we already ask for the Screen Recording permission that provides the title, hence we shouldn't need the Accessibility one or inspect Chrome for the url since we don't require that information.
These changes allow to pass the following options:
accessCheck: false
-- disables the accessibility checks and so the OS promptsappleScript: false
-- disables the use of apple script (used to obtain the URL only)Hopefully this is something most people will find useful. And thanks for the library!