varjolintu / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.

Home Page:https://keepassxc.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unable to enable native messaging

dancju opened this issue · comments

I am configuring keepassxc-browser extension for Chrome, but I can not see a "browser extension (native messaging)" button in the KeePassXC settings as this image shows.

https://camo.githubusercontent.com/8d0d611427556077c0e7ebefca2e70185661a8d4/68747470733a2f2f692e696d6775722e636f6d2f33445a657033422e706e67

There are only three icons in the left panel in my KeePassXC settings namely "General", "Security", and "Browser Integration". I can not find the option to enable native messaging.

Here is the debug info.

KeePassXC - Version 2.2.0
Revision: caa49a8ef3ee28ed478192389b21d61107b3b8e0

Libraries:
- Qt 5.9.1
- libgcrypt 1.8.1

Operating system: Arch Linux
CPU architecture: x86_64
Kernel: linux 4.12.13-1-ARCH

Enabled extensions:
- KeePassHTTP
- Auto-Type
- YubiKey

If you built the sources by yourself, please first checkout&fetch&pull the feature/chromeKeePassXC branch and build KeePassXC with -DWITH_XC_BROWSER=ON.

I did not build from source. I installed it from Arch Linux Repository.
https://www.archlinux.org/packages/community/x86_64/keepassxc/
Maybe I should contact the maintainer @City-busz ?

I tried building from source with command

    cmake -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_INSTALL_BINDIR=/usr/bin \
        -DCMAKE_INSTALL_LIBDIR=/usr/lib \
        -DCMAKE_VERBOSE_MAKEFILE=OFF \
        -DWITH_GUI_TESTS=ON \
        -DWITH_XC_AUTOTYPE=ON \
        -DWITH_XC_BROWSER=ON \
        -DWITH_XC_HTTP=ON \
        -DWITH_XC_YUBIKEY=ON \
        -DCMAKE_BUILD_TYPE=Release ..
    make

, but got this error message

CMake Warning:
  Manually-specified variables were not used by the project:

    WITH_XC_BROWSER

You are clearly using an official package. Native Messaging feature doesn't exist in it. Try this one?

thank you very much.

I just installed keepassxc-browser-git from AUR. Now I can see a Native Messaging option in KeePassXC settings. The legacy flavour "Browser Integration" option is no longer to be seen but it does not matter.

But I can not get chrome extension keepassxc-browser connected. I see this message on chrome extension:

keepassxc-browser has encountered an error:
Timeout or not connected to KeePassXC

Please see this wiki.

I have done all the steps excepting the optional step. I even checked ~/.config/google-chrome/NativeMessagingHosts/com.varjolintu.keepassxc_browser.json which seems good.

When I click 'Reload' in chrome extension, KeePassXC gives an empty message to GNOME notification tray, like keepassxc and chrome extension are somehow communicating. However, keepassxc does not apprise a "new key association request".

I suggest you try to compile the sources. The AUR package might not hold all the recent fixes.

the AUR package is not actually a package. it is a script which clone and build package from THIS repo.

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=keepassxc-browser-git

so i guess it has all the latest fixes. this is my debug info after installed this AUR package:

KeePassXC - Version 2.2.0
Revision: a8bceb621e8512361ab3d8af08ae9ae1ca04d8cb

Libraries:
- Qt 5.9.1
- libgcrypt 1.8.1

Operating system: Arch Linux
CPU architecture: x86_64
Kernel: linux 4.12.13-1-ARCH

Enabled extensions:
- Auto-Type
- YubiKey
- Native Messaging browser extension

Revision: a8bceb621e8512361ab3d8af08ae9ae1ca04d8cb means it being the latest git version.

What does the browser javascript console say?

javascript console says:

Uncaught (in promise) {message: "The message port closed before a response was received."}

when i click "Reload"

Anything else that is related to keepassxc-browser, like error messages?

cheers! i just found out how to make it works.
if i click "reload" with keepassxc open, it does not work.
if i click "reload" without keepassxc open, it works.

Yes. The Reload button lets the browser process reload the KeePassXC so the Native Messaging pipe can be initialized :) The connection cannot be made if KeePassXC is already open. If you wish to use KeePassXC and keepassxc-browser this way, check the optional proxy application.

but this entails another problem:

when launch in hidpi screen and gnome, keepassxc is almost unusable, since all the characters and buttons are very small.
my solution for this is editing the command in desktop entry:

QT_SCALE_FACTOR=2 keepassxc

so the keepassxc window is x2 up scaled.

now i have to launch keepassxc from chrome, and everything is small again.

You cannot use optional parameters with Native Messaging so there's no other solution to this than use the keepassxc-proxy.

thank you