displaying extension name in views

This commit is contained in:
antelle 2021-04-27 20:01:53 +02:00
parent 12fc33a15e
commit 2f4a9d450a
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
4 changed files with 14 additions and 9 deletions

View File

@ -188,12 +188,8 @@ async function checkContentRequestPermissions(request) {
}
}
const extensionName = client.connection.appName
? `${client.connection.extensionName} (${client.connection.appName})`
: client.connection.extensionName;
const extensionConnectView = new ExtensionConnectView({
extensionName,
extensionName: getHumanReadableExtensionName(client),
identityVerified: !Launcher,
files,
allFiles: config?.allFiles ?? true,
@ -272,6 +268,12 @@ function isKeePassXcBrowser(request) {
return getClient(request).connection.extensionName === 'KeePassXC-Browser';
}
function getHumanReadableExtensionName(client) {
return client.connection.appName
? `${client.connection.extensionName} (${client.connection.appName})`
: client.connection.extensionName;
}
function focusKeeWeb() {
logger.debug('Focus KeeWeb');
if (Launcher) {
@ -527,6 +529,7 @@ const ProtocolHandlers = {
}
const saveEntryView = new ExtensionSaveEntryView({
extensionName: getHumanReadableExtensionName(client),
url: payload.url,
user: payload.login,
askSave: RuntimeDataModel.extensionSaveConfig?.askSave || 'always',
@ -664,7 +667,9 @@ const ProtocolHandlers = {
}
}
const client = getClient(request);
const createGroupView = new ExtensionCreateGroupView({
extensionName: getHumanReadableExtensionName(client),
groupPath: groupNames.join(' / '),
files: files.map((f, ix) => ({ id: f.id, name: f.name, selected: ix === 0 }))
});

View File

@ -791,11 +791,11 @@
"extensionConnectSettingsAreForSession": "Settings you select here are valid only for the active session. You can view and manage sessions in KeeWeb settings.",
"extensionUnlockMessage": "Unlock to connect a browser extension",
"extensionNewGroupHeader": "New group",
"extensionNewGroupBody": "A browser extension is trying to create a new group. Allow this?",
"extensionNewGroupBody": "{} is trying to create a new group. Allow this?",
"extensionNewGroupPath": "Group path",
"extensionNewGroupFile": "This group will be created in:",
"extensionSaveEntryHeader": "Save password",
"extensionSaveEntryBody": "A browser extension is trying to save a password. Allow this?",
"extensionSaveEntryBody": "{} is trying to save a password. Allow this?",
"extensionSaveEntryAuto": "Save other passwords automatically in this session",
"extensionSaveEntryNewGroup": "new group"
}

View File

@ -1,5 +1,5 @@
<div class="extension-create-group">
<p>{{res 'extensionNewGroupBody'}}</p>
<p>{{#res 'extensionNewGroupBody'}}{{extensionName}}{{/res}}</p>
<p>{{res 'extensionNewGroupPath'}}: {{groupPath}}</p>
<div>
<label for="extension-create-group__file">{{res 'extensionNewGroupFile'}}</label>

View File

@ -1,5 +1,5 @@
<div class="extension-save-entry">
<p>{{res 'extensionSaveEntryBody'}}</p>
<p>{{#res 'extensionSaveEntryBody'}}{{extensionName}}{{/res}}</p>
<p>
<label for="extension-save-entry__url">{{Res 'website'}}:</label>
<span id="extension-save-entry__url">{{url}}</span>