2
2
mirror of https://github.com/Llewellynvdm/nativefier.git synced 2024-11-15 17:27:08 +00:00
nativefier/package.json
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

103 lines
3.0 KiB
JSON

{
"name": "nativefier",
"version": "42.3.0",
"description": "Wrap web apps natively",
"license": "MIT",
"author": "Goh Jia Hao",
"engines": {
"node": ">= 10.0.0",
"npm": ">= 6.0.0"
},
"keywords": [
"desktop",
"electron",
"app",
"native",
"wrapper"
],
"main": "lib/main.js",
"typings": "lib/main.d.ts",
"bin": {
"nativefier": "lib/cli.js"
},
"homepage": "https://github.com/nativefier/nativefier",
"repository": {
"type": "git",
"url": "git+https://github.com/nativefier/nativefier.git"
},
"bugs": {
"url": "https://github.com/nativefier/nativefier/issues"
},
"scripts": {
"build-app": "cd app && webpack",
"build-app-static": "ncp app/src/static/ app/lib/static/ && ncp app/dist/preload.js app/lib/preload.js && ncp app/dist/preload.js.map app/lib/preload.js.map",
"build": "npm run clean && tsc --build . app && npm run build-app && npm run build-app-static",
"build:watch": "tsc --build . app --watch",
"changelog": "./docs/generate-changelog",
"ci": "npm run lint && npm test",
"clean": "rimraf lib/ app/lib/ app/dist/",
"clean:full": "rimraf lib/ app/lib/ app/dist/ app/node_modules/ node_modules/",
"lint:fix": "eslint . --fix",
"lint:format": "prettier --write 'src/**/*.js' 'app/src/**/*.js'",
"lint": "eslint . --ext .ts",
"list-outdated-deps": "npm out; cd app && npm out; true",
"prepare": "cd app && npm install && cd .. && npm run build",
"test:integration": "jest --testRegex '.*integration-test.js'",
"test:manual": "npm run build && ./docs/manual-test",
"test:unit": "jest",
"test:watch": "jest --watch",
"test:withlog": "LOGLEVEL=trace npm run test",
"test": "jest --testRegex '[-.]test\\.js$'",
"watch": "npx concurrently \"npm:*:watch\""
},
"dependencies": {
"axios": "^0.21.1",
"commander": "^7.1.0",
"electron-packager": "^15.2.0",
"gitcloud": "^0.2.0",
"hasbin": "^1.2.3",
"loglevel": "^1.7.1",
"ncp": "^2.0.0",
"page-icon": "^0.4.0",
"sanitize-filename": "^1.6.3",
"source-map-support": "^0.5.19",
"tmp": "^0.2.1"
},
"devDependencies": {
"@types/jest": "^26.0.20",
"@types/ncp": "^2.0.4",
"@types/node": "^10.17.54",
"@types/page-icon": "^0.3.3",
"@types/tmp": "^0.2.0",
"@typescript-eslint/eslint-plugin": "^4.15.2",
"@typescript-eslint/parser": "^4.15.2",
"eslint": "^7.20.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-prettier": "^3.3.1",
"jest": "^26.6.3",
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"ts-loader": "^8.0.17",
"typescript": "^4.2.2",
"webpack": "^5.24.2",
"webpack-cli": "^4.5.0"
},
"jest": {
"collectCoverage": true,
"setupFiles": [
"./lib/jestSetupFiles"
],
"testEnvironment": "node",
"testPathIgnorePatterns": [
"/node_modules/",
"<rootDir>/app/src.*",
"<rootDir>/src.*"
]
},
"prettier": {
"arrowParens": "always",
"singleQuote": true,
"trailingComma": "all"
}
}