Skip to content

Conversation

sebastianlivoni
Copy link

@sebastianlivoni sebastianlivoni commented Apr 11, 2025

This pull request embeds the KeePassXC-Browser extension within the KeePassXC app on macOS. Safari 18.4 introduced the option to distribute Safari Web Extension outside App Store.

I've added the keepassxc-browser repository as a submodule. Currently this repository is linked to my own fork. I've submitted a pull request with required changes for the keepassxc-browser extension. The submodule must be changed to the original keepassxc-browser repository.

In order to test this, please build it with CMake option -DWITH_XC_SAFARI_WEB_EXTENSION=ON. Please make sure to use the release tool for signing the application. After this, the application must be opened once for the web extension to show in Safari or use the checkbox within the Browser Settings tab.

Example building command within the build directory:
cmake -DWITH_TESTS=OFF -DWITH_XC_ALL=ON -DCMAKE_BUILD_TYPE=Release -DAPPLE_TEAM_ID="<your team identifier>" -DAPPLE_APP_IDENTIFIER="<your app identifier>" .. && make -j8 package && cd .. && ./release-tool appsign -I "<Your apple developer identitiy>" -f <path to the app> && cd build

Screenshots

An option for enabling the Safari Web Extension is shown in Browser-integration tab in the KeepPassXC app.
image
When the checkbox is clicked it opens the Safari and shows the an option to enable the extension.
image
Popup shown in toolbar:
Safari 2025-04-11 15 56 19
Settings page:
image

Testing strategy

  • Conducted progressively as development continued.

Type of change

  • ✅ New feature (change that adds functionality)

@sebastianlivoni sebastianlivoni changed the title Feature/safari web extension Embedding KeePassXC-Browser in KeePassXC app on macOS Apr 11, 2025
@sebastianlivoni sebastianlivoni changed the title Embedding KeePassXC-Browser in KeePassXC app on macOS Embedding KeePassXC-Browser in KeePassXC app on macOS for Safari Apr 11, 2025
@sebastianlivoni sebastianlivoni marked this pull request as ready for review April 11, 2025 14:28
@Copilot Copilot AI review requested due to automatic review settings April 11, 2025 14:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 11 out of 23 changed files in this pull request and generated no comments.

Files not reviewed (12)
  • .gitmodules: Language not supported
  • CMakeLists.txt: Language not supported
  • release-tool: Language not supported
  • share/macosx/Info.plist.cmake: Language not supported
  • share/macosx/keepassxc_entitlements.cmake: Language not supported
  • src/CMakeLists.txt: Language not supported
  • src/browser/BrowserSharedMac.mm: Language not supported
  • src/browser/CMakeLists.txt: Language not supported
  • src/proxy/CMakeLists.txt: Language not supported
  • src/safariwebextension/CMakeLists.txt: Language not supported
  • src/safariwebextension/Info.plist: Language not supported
  • src/safariwebextension/SafariWebExtensionCheckbox.mm: Language not supported

@varjolintu varjolintu self-requested a review April 11, 2025 15:24
@varjolintu varjolintu added feature: Browser pr: new feature Pull request adds a new feature labels Apr 11, 2025

# macOS App Bundle
if(APPLE AND WITH_APP_BUNDLE)
set(APPLE_TEAM_ID "G2S7P7J672" CACHE STRING "Apple Developer Team ID")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check this ID.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its came from share/macosx/keepassxc.entitlements

@varjolintu
Copy link
Member

Embedding the extension in the application itself prevents any extension updates. If there's some bug, only a new KeePassXC release will fix it with Safari.

@varjolintu varjolintu requested a review from phoerious April 11, 2025 16:13
@sebastianlivoni sebastianlivoni changed the title Embedding KeePassXC-Browser in KeePassXC app on macOS for Safari Embedding KeePassXC-Browser as Safari Web Extension within KeePassXC on macOS Apr 12, 2025
@TahirJalilov
Copy link

Any news?

@guoqiang5277
Copy link

When can the code be merged and released? What's the current progress? Can it be expedited? This feature is really needed.

@varjolintu
Copy link
Member

When can the code be merged and released? What's the current progress? Can it be expedited? This feature is really needed.

Read my previous comment. Plus I haven't had time to review this properly yet. I would be still in favor of keeping the extension separate, not embedded.

@guoqiang5277
Copy link

When can the code be merged and released? What's the current progress? Can it be expedited? This feature is really needed.

Read my previous comment. Plus I haven't had time to review this properly yet. I would be still in favor of keeping the extension separate, not embedded.

As a user, I don't care which method is used. What I'm more concerned about is when it can be used and when the passwords saved in KeepassXC can be used in Safari browser.

@varjolintu
Copy link
Member

When can the code be merged and released? What's the current progress? Can it be expedited? This feature is really needed.

Read my previous comment. Plus I haven't had time to review this properly yet. I would be still in favor of keeping the extension separate, not embedded.

As a user, I don't care which method is used. What I'm more concerned about is when it can be used and when the passwords saved in KeepassXC can be used in Safari browser.

As a developer, I do care :) The extension is updated much more frequently than KeePassXC. If the extension is embedded to the main application, extension will not get updates unless a new version of KeePassXC is released.

@sebastianlivoni
Copy link
Author

I believe the best approach is to embed the browser extension within KeePassXC.

I understand the concern about needing to update KeePassXC for macOS whenever a new version of the extension is released. However, the alternative - packaging the extension as a separate app - prevents KeePassXC from being able to send messages directly to the Safari extension.

By embedding the extension:

  • KeePassXC can communicate directly with the Safari extension such as unlocking and locking messages (not possible with packaging it as a separate app).
  • KeePassXC can open Safari preferences from within the app, making it easier for users to enable the extension.

Additionally, this seems to be the approach Apple intends Safari extensions to follow, so aligning with it makes sense.

@sebastianlivoni sebastianlivoni force-pushed the feature/safari-web-extension branch from d982682 to 5ebcb6f Compare June 7, 2025 22:11
@sebastianlivoni sebastianlivoni marked this pull request as draft June 18, 2025 23:06
@sebastianlivoni sebastianlivoni force-pushed the feature/safari-web-extension branch from 8c1e059 to 361cf06 Compare August 1, 2025 15:24
@sebastianlivoni sebastianlivoni force-pushed the feature/safari-web-extension branch from 361cf06 to 56b63a9 Compare August 1, 2025 15:27
@sebastianlivoni
Copy link
Author

sebastianlivoni commented Aug 1, 2025

Would it be possible to change --recurse-submodules=no to --recurse-submodules=yes in TeamCity builds to clone the keepass-browser submodule for MacOS? Currently, it is disabled and hence the build fails for MacOS.

@sebastianlivoni sebastianlivoni marked this pull request as ready for review August 5, 2025 14:17
@DrRamm
Copy link

DrRamm commented Aug 22, 2025

Any news?

1 similar comment
@guoqiang5277
Copy link

Any news?

@varjolintu
Copy link
Member

Read the previous comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: Browser pr: new feature Pull request adds a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants