added an explanation about auto-type issues on macOS

This commit is contained in:
antelle 2021-02-04 20:54:13 +01:00
parent 4f8075ca6c
commit fa1a16f140
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
6 changed files with 26 additions and 1 deletions

View File

@ -144,6 +144,10 @@ class AutoTypeEmitter {
}
})
.catch((err) => {
const keyPressFailed = err.message === 'Key press failed';
if (keyPressFailed) {
err.keyPressFailed = true;
}
try {
this.callback(err);
} catch (err) {

View File

@ -3,12 +3,14 @@ import { AutoTypeFilter } from 'auto-type/auto-type-filter';
import { AutoTypeHelperFactory } from 'auto-type/auto-type-helper-factory';
import { AutoTypeParser } from 'auto-type/auto-type-parser';
import { Launcher } from 'comp/launcher';
import { Features } from 'util/features';
import { Alerts } from 'comp/ui/alerts';
import { Timeouts } from 'const/timeouts';
import { AppSettingsModel } from 'models/app-settings-model';
import { AppModel } from 'models/app-model';
import { Locale } from 'util/locale';
import { Logger } from 'util/logger';
import { Links } from 'const/links';
import { AutoTypeSelectView } from 'views/auto-type/auto-type-select-view';
const logger = new Logger('auto-type');
@ -63,9 +65,16 @@ const AutoType = {
runAndHandleResult(result, windowId) {
this.run(result, windowId, (err) => {
if (err) {
let body = Locale.autoTypeErrorGeneric.replace('{}', err.message || err.toString());
let link;
if (err.keyPressFailed && Features.isMac) {
body = Locale.autoTypeErrorAccessibilityMacOS;
link = Links.AutoTypeMacOS;
}
Alerts.error({
header: Locale.autoTypeError,
body: Locale.autoTypeErrorGeneric.replace('{}', err.toString())
body,
link
});
}
});

View File

@ -12,6 +12,7 @@ const Links = {
SelfHostedDropbox: 'https://github.com/keeweb/keeweb#self-hosting',
UpdateJson: 'https://app.keeweb.info/update.json',
AutoType: 'https://github.com/keeweb/keeweb/wiki/Auto-Type',
AutoTypeMacOS: 'https://github.com/keeweb/keeweb/wiki/Auto-Type#macos',
Translation: 'https://keeweb.oneskyapp.com/',
Donation: 'https://opencollective.com/keeweb#support',
Plugins: 'https://plugins.keeweb.info',

View File

@ -323,6 +323,7 @@
"autoTypeLink": "more...",
"autoTypeError": "Auto-type error",
"autoTypeErrorGeneric": "There was an error performing auto-type: {}",
"autoTypeErrorAccessibilityMacOS": "We tried to send keystrokes to the application, but it doesn't seem to work. This may happen because of missing permissions, click here to read more about it:",
"autoTypeErrorGlobal": "To use a system-wide shortcut, please focus the app where you want to type your password",
"autoTypeErrorNotInstalled": "{} is not installed",
"autoTypeHeader": "Auto-Type: Select",

View File

@ -1,4 +1,5 @@
import { View } from 'framework/views/view';
import { Launcher } from 'comp/launcher';
import { Keys } from 'const/keys';
import template from 'templates/modal.hbs';
@ -10,6 +11,7 @@ class ModalView extends View {
events = {
'click .modal__buttons button': 'buttonClick',
'click .modal__link': 'linkClick',
'click': 'bodyClick'
};
@ -55,6 +57,13 @@ class ModalView extends View {
this.closeWithResult(result);
}
linkClick(e) {
if (Launcher) {
e.preventDefault();
Launcher.openLink(e.target.href);
}
}
bodyClick(e) {
if (typeof this.model.click === 'string' && !e.target.matches('button')) {
this.closeWithResult(this.model.click);

View File

@ -10,6 +10,7 @@
{{#unless @last}}<br/>{{/unless}}
{{/each}}
{{#if pre}}<pre class="modal__pre">{{pre}}</pre>{{/if}}
{{#if link}}<a href="{{link}}" class="modal__link" target="_blank">{{link}}</a>{{/if}}
{{#if hint}}<p class="muted-color">{{hint}}</p>{{/if}}
{{#if checkbox}}
<div class="modal__check-wrap"><input type="checkbox" id="modal__check" /><label for="modal__check">{{checkbox}}</label></div>