2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-12-22 18:18:55 +00:00
nativefier/app
Adam Weeden adcf21a3df
macOS: Prompt for accessibility permissions if needed by Global Shortcuts using Media Keys (Fix #1120) (PR #1121)
When setting a media key (play, pause, next/previous track) as global shortcut in Mac OS 10.14+, accessibility permissions must be given to the app for it to work (see https://www.electronjs.org/docs/api/global-shortcut?q=MediaPlayPause#globalshortcutregisteraccelerator-callback).

This PR will accomplish the following on generated app launch:
- Check if global shortcuts are being setup
- Check if the host OS is Mac OS
- Check if the global shortcuts were one of the media keys
- If the above are true, check if the app has accessibility permissions
- If the app does not have the accessibility permissions it will ask the user if they would like to be prompted for these permissions, and then ask Mac OS to prompt for accessibility permissions.

~~As well, a new command line flag is added (`--no-accessibility-prompt`) to preventatively suppress these prompts if desired.~~

Screenshots of the new behavior:
![Screen Shot 2021-02-26 at 2 41 21 PM](https://user-images.githubusercontent.com/547567/109356260-76bfde00-784e-11eb-8c36-3a51b911b780.png)
![Screen Shot 2021-02-26 at 2 41 28 PM](https://user-images.githubusercontent.com/547567/109356266-79223800-784e-11eb-94eb-66437c05fd10.png)
![Screen Shot 2021-02-26 at 2 41 50 PM](https://user-images.githubusercontent.com/547567/109356270-7aebfb80-784e-11eb-9e90-e09bb49752c6.png)

Co-authored-by: Ronan Jouchet <ronan@jouchet.fr>
2021-02-28 10:24:14 -05:00
..
inject Fix bug where css is always injected 2016-02-25 15:25:14 +08:00
src macOS: Prompt for accessibility permissions if needed by Global Shortcuts using Media Keys (Fix #1120) (PR #1121) 2021-02-28 10:24:14 -05:00
.eslintrc.js Bump eslint to 7.x, fix new lint errors 2020-07-18 11:19:58 -04:00
.npmrc Upgrade dependencies and default to latest Electron 1.7.9 (PR #483) 2017-11-14 08:05:01 -05:00
nativefier.json Fix placeholder for electron app to google 2016-05-26 16:50:42 +08:00
package.json (Attempt to) get rid of deprecated app dep wurl 2021-02-25 18:55:28 -05:00
tsconfig.json TSConfig: bump to target/lib es2018, since we require node10 2021-02-26 22:50:59 -05:00
webpack.config.js Fix failing to global-sudo-install due to postinstall script (fix #923) 2020-03-16 21:06:03 -04:00