diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/Info.plist b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/Info.plist
new file mode 100644
index 00000000..65bf6c69
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/Info.plist
@@ -0,0 +1,33 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleDisplayName
+ KeePassXC-Browser Extension
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ $(PRODUCT_BUNDLE_PACKAGE_TYPE)
+ CFBundleShortVersionString
+ $(MARKETING_VERSION)
+ CFBundleVersion
+ 1
+ LSMinimumSystemVersion
+ $(MACOSX_DEPLOYMENT_TARGET)
+ NSExtension
+
+ NSExtensionPointIdentifier
+ com.apple.Safari.web-extension
+ NSExtensionPrincipalClass
+ $(PRODUCT_MODULE_NAME).SafariWebExtensionHandler
+
+
+
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/KeePassXC_Browser_Extension.entitlements b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/KeePassXC_Browser_Extension.entitlements
new file mode 100644
index 00000000..d00fc3d6
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/KeePassXC_Browser_Extension.entitlements
@@ -0,0 +1,12 @@
+
+
+
+
+ com.apple.security.app-sandbox
+
+ com.apple.security.network.client
+
+ com.apple.security.application-groups
+ org.keepassxc.KeePassXC
+
+
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/SafariWebExtensionHandler.swift b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/SafariWebExtensionHandler.swift
new file mode 100644
index 00000000..8de7fbf5
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser Extension/SafariWebExtensionHandler.swift
@@ -0,0 +1,163 @@
+/*
+ * Copyright (C) 2023 KeePassXC Team
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+import SafariServices
+import os.log
+
+let SFExtensionMessageKey = "message"
+let SocketFileName = "org.keepassxc.KeePassXC.BrowserServer"
+var socketFD : Int32 = -1
+var socketConnected = false
+var maxMessageLength: Int32 = 1024 * 1024;
+
+class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling {
+ func getSocketPath() -> String {
+ let homePath = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "org.keepassxc.KeePassXC")?.path
+ return homePath! + "/" + SocketFileName;
+ }
+
+ func closeSocket() {
+ if (socketFD != -1) {
+ os_log(.default, "Closing socket")
+ close(socketFD)
+ socketFD = -1
+ }
+ }
+
+ func connectSocket() -> Bool {
+ if (socketFD != -1) {
+ // Reuse socket
+ return true
+ }
+
+ socketFD = socket(PF_LOCAL, SOCK_STREAM, 0)
+ os_log(.default, "Create socket: %d" , socketFD)
+ if (socketFD == -1) {
+ os_log(.error, "Cannot create socket")
+ return false
+ }
+
+ var optval: Int = 1; // Use 1 to enable the option, 0 to disable
+ let status = setsockopt(socketFD, SOL_SOCKET,
+ SO_REUSEADDR, &optval, socklen_t(MemoryLayout.size))
+ if (status == -1) {
+ os_log(.error, "setsockopt error: %d", errno)
+ return false
+ }
+
+ guard setsockopt(socketFD, SOL_SOCKET, SO_SNDBUF, &maxMessageLength, socklen_t(MemoryLayout.size(ofValue: maxMessageLength))) != -1 else {
+ os_log(.error, "setsockopt error")
+ return false
+ }
+
+ let socketPath = getSocketPath()
+ os_log(.default, "Socket path: %s", socketPath)
+
+ // Check if socket file exists
+ let fileManager = FileManager.default
+ if fileManager.fileExists(atPath: socketPath) {
+ os_log(.default, "Socket file exists")
+ } else {
+ os_log(.default, "Socket file does not exist")
+ return false
+ }
+
+ var addr = sockaddr_un()
+ addr.sun_family = UInt8(AF_LOCAL)
+ let lengthOfPath = socketPath.utf8.count
+ guard lengthOfPath < MemoryLayout.size(ofValue: addr.sun_path) else {
+ os_log(.error, "Pathname is too long")
+ return false
+ }
+
+ strlcpy(&addr.sun_path.0, socketPath, MemoryLayout.size(ofValue: addr.sun_path))
+ addr.sun_len = UInt8(MemoryLayout.size + MemoryLayout.size + lengthOfPath + 1)
+
+ let sockLen = socklen_t(addr.sun_len)
+ let result = withUnsafePointer(to: &addr) {
+ $0.withMemoryRebound(to: sockaddr.self, capacity: 1) {
+ connect(socketFD, $0, sockLen)
+ }
+ }
+
+ if (result == -1) {
+ let strError = String(utf8String: strerror(errno)) ?? "Unknown error"
+ os_log(.error, "Cannot connect socket: %s", strError)
+ return false
+ }
+
+ return true
+ }
+
+ func beginRequest(with context: NSExtensionContext) {
+ guard let item = context.inputItems.first as? NSExtensionItem else {
+ os_log(.error, "Invalid amount of arguments for NSExtensionItem")
+ return
+ }
+
+ guard let dict = item.userInfo?[SFExtensionMessageKey] as? Dictionary else {
+ os_log(.error, "Invalid Safari extension message receieved")
+ return
+ }
+
+ guard let message = dict["message"] as? String else {
+ os_log(.error, "Invalid extension message receieved")
+ return
+ }
+
+ os_log(.default, "JSON string: %{public}s", message)
+
+ if (!socketConnected) {
+ if (!connectSocket()) {
+ closeSocket()
+ os_log(.error, "Socket not connected")
+ return
+ }
+
+ socketConnected = true
+ }
+
+ // Send message
+ let bytesWritten = write(socketFD, message, message.count)
+ if (bytesWritten == -1) {
+ os_log(.error, "Cannot write to socket %d", errno)
+ return
+ }
+
+ os_log(.default, "Written %d bytes", bytesWritten)
+
+ // Receive response
+ let receiveBuffer = UnsafeMutablePointer.allocate(capacity: Int(maxMessageLength))
+ let bytesRead = read(socketFD, receiveBuffer, Int(maxMessageLength))
+ if (bytesRead > 0) {
+ os_log(.default, "Read %d bytes", bytesRead)
+
+ let responseString = String.init(bytesNoCopy: receiveBuffer, length: bytesRead, encoding: .utf8, freeWhenDone: false)
+
+ os_log(.default, "Response: %{public}s", responseString!)
+
+ // Send the response to the extension
+ let response = NSExtensionItem()
+ response.userInfo = [ SFExtensionMessageKey: [ responseString ] ]
+ context.completeRequest(returningItems: [response], completionHandler: nil)
+ } else {
+ os_log(.error, "Error reading from socket %d", errno)
+ }
+
+ receiveBuffer.deallocate()
+ }
+}
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.pbxproj b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.pbxproj
new file mode 100644
index 00000000..f0099082
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.pbxproj
@@ -0,0 +1,547 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 54;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 632F5844280BED1100BF1247 /* options in Resources */ = {isa = PBXBuildFile; fileRef = 632F5838280BED1000BF1247 /* options */; };
+ 632F5846280BED1100BF1247 /* popups in Resources */ = {isa = PBXBuildFile; fileRef = 632F583A280BED1000BF1247 /* popups */; };
+ 632F5847280BED1100BF1247 /* css in Resources */ = {isa = PBXBuildFile; fileRef = 632F583B280BED1000BF1247 /* css */; };
+ 632F5848280BED1100BF1247 /* content in Resources */ = {isa = PBXBuildFile; fileRef = 632F583C280BED1000BF1247 /* content */; };
+ 632F5849280BED1100BF1247 /* _locales in Resources */ = {isa = PBXBuildFile; fileRef = 632F583D280BED1000BF1247 /* _locales */; };
+ 632F584A280BED1100BF1247 /* bootstrap in Resources */ = {isa = PBXBuildFile; fileRef = 632F583E280BED1000BF1247 /* bootstrap */; };
+ 632F584B280BED1100BF1247 /* common in Resources */ = {isa = PBXBuildFile; fileRef = 632F583F280BED1000BF1247 /* common */; };
+ 632F584C280BED1100BF1247 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 632F5840280BED1100BF1247 /* fonts */; };
+ 632F584D280BED1100BF1247 /* background in Resources */ = {isa = PBXBuildFile; fileRef = 632F5841280BED1100BF1247 /* background */; };
+ 632F584E280BED1100BF1247 /* icons in Resources */ = {isa = PBXBuildFile; fileRef = 632F5842280BED1100BF1247 /* icons */; };
+ 632F584F280BED1100BF1247 /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 632F5843280BED1100BF1247 /* manifest.json */; };
+ 63A6D8FC25193F3A00BD9198 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A6D8FB25193F3A00BD9198 /* AppDelegate.swift */; };
+ 63A6D8FF25193F3A00BD9198 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 63A6D8FD25193F3A00BD9198 /* Main.storyboard */; };
+ 63A6D90125193F3A00BD9198 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A6D90025193F3A00BD9198 /* ViewController.swift */; };
+ 63A6D90325193F3A00BD9198 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 63A6D90225193F3A00BD9198 /* Assets.xcassets */; };
+ 63A6D90A25193F3B00BD9198 /* KeePassXC-Browser Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 63A6D90925193F3B00BD9198 /* KeePassXC-Browser Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+ 63A6D90F25193F3B00BD9198 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63A6D90E25193F3B00BD9198 /* Cocoa.framework */; };
+ 63A6D91225193F3B00BD9198 /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 63A6D91125193F3B00BD9198 /* SafariWebExtensionHandler.swift */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 63A6D90B25193F3B00BD9198 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 63A6D8EF25193F3A00BD9198 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 63A6D90825193F3B00BD9198;
+ remoteInfo = "KeePassXC-Browser Extension";
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+ 63A6D91A25193F3B00BD9198 /* Embed App Extensions */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 2147483647;
+ dstPath = "";
+ dstSubfolderSpec = 13;
+ files = (
+ 63A6D90A25193F3B00BD9198 /* KeePassXC-Browser Extension.appex in Embed App Extensions */,
+ );
+ name = "Embed App Extensions";
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+ 632F5838280BED1000BF1247 /* options */ = {isa = PBXFileReference; lastKnownFileType = folder; name = options; path = "../../../keepassxc-browser/options"; sourceTree = ""; };
+ 632F583A280BED1000BF1247 /* popups */ = {isa = PBXFileReference; lastKnownFileType = folder; name = popups; path = "../../../keepassxc-browser/popups"; sourceTree = ""; };
+ 632F583B280BED1000BF1247 /* css */ = {isa = PBXFileReference; lastKnownFileType = folder; name = css; path = "../../../keepassxc-browser/css"; sourceTree = ""; };
+ 632F583C280BED1000BF1247 /* content */ = {isa = PBXFileReference; lastKnownFileType = folder; name = content; path = "../../../keepassxc-browser/content"; sourceTree = ""; };
+ 632F583D280BED1000BF1247 /* _locales */ = {isa = PBXFileReference; lastKnownFileType = folder; name = _locales; path = "../../../keepassxc-browser/_locales"; sourceTree = ""; };
+ 632F583E280BED1000BF1247 /* bootstrap */ = {isa = PBXFileReference; lastKnownFileType = folder; name = bootstrap; path = "../../../keepassxc-browser/bootstrap"; sourceTree = ""; };
+ 632F583F280BED1000BF1247 /* common */ = {isa = PBXFileReference; lastKnownFileType = folder; name = common; path = "../../../keepassxc-browser/common"; sourceTree = ""; };
+ 632F5840280BED1100BF1247 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fonts; path = "../../../keepassxc-browser/fonts"; sourceTree = ""; };
+ 632F5841280BED1100BF1247 /* background */ = {isa = PBXFileReference; lastKnownFileType = folder; name = background; path = "../../../keepassxc-browser/background"; sourceTree = ""; };
+ 632F5842280BED1100BF1247 /* icons */ = {isa = PBXFileReference; lastKnownFileType = folder; name = icons; path = "../../../keepassxc-browser/icons"; sourceTree = ""; };
+ 632F5843280BED1100BF1247 /* manifest.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = manifest.json; path = "../../../keepassxc-browser/manifest.json"; sourceTree = ""; };
+ 63A6D8F725193F3A00BD9198 /* KeePassXC-Browser.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "KeePassXC-Browser.app"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 63A6D8FA25193F3A00BD9198 /* KeePassXC_Browser.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = KeePassXC_Browser.entitlements; sourceTree = ""; };
+ 63A6D8FB25193F3A00BD9198 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
+ 63A6D8FE25193F3A00BD9198 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
+ 63A6D90025193F3A00BD9198 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
+ 63A6D90225193F3A00BD9198 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
+ 63A6D90425193F3A00BD9198 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 63A6D90925193F3B00BD9198 /* KeePassXC-Browser Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "KeePassXC-Browser Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 63A6D90E25193F3B00BD9198 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ 63A6D91125193F3B00BD9198 /* SafariWebExtensionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionHandler.swift; sourceTree = ""; };
+ 63A6D91325193F3B00BD9198 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
+ 63A6D91425193F3B00BD9198 /* KeePassXC_Browser_Extension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = KeePassXC_Browser_Extension.entitlements; sourceTree = ""; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 63A6D8F425193F3A00BD9198 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 63A6D90625193F3B00BD9198 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63A6D90F25193F3B00BD9198 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 63A6D8EE25193F3A00BD9198 = {
+ isa = PBXGroup;
+ children = (
+ 63A6D8F925193F3A00BD9198 /* KeePassXC-Browser */,
+ 63A6D91025193F3B00BD9198 /* KeePassXC-Browser Extension */,
+ 63A6D90D25193F3B00BD9198 /* Frameworks */,
+ 63A6D8F825193F3A00BD9198 /* Products */,
+ );
+ sourceTree = "";
+ };
+ 63A6D8F825193F3A00BD9198 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 63A6D8F725193F3A00BD9198 /* KeePassXC-Browser.app */,
+ 63A6D90925193F3B00BD9198 /* KeePassXC-Browser Extension.appex */,
+ );
+ name = Products;
+ sourceTree = "";
+ };
+ 63A6D8F925193F3A00BD9198 /* KeePassXC-Browser */ = {
+ isa = PBXGroup;
+ children = (
+ 63A6D8FA25193F3A00BD9198 /* KeePassXC_Browser.entitlements */,
+ 63A6D8FB25193F3A00BD9198 /* AppDelegate.swift */,
+ 63A6D8FD25193F3A00BD9198 /* Main.storyboard */,
+ 63A6D90025193F3A00BD9198 /* ViewController.swift */,
+ 63A6D90225193F3A00BD9198 /* Assets.xcassets */,
+ 63A6D90425193F3A00BD9198 /* Info.plist */,
+ );
+ path = "KeePassXC-Browser";
+ sourceTree = "";
+ };
+ 63A6D90D25193F3B00BD9198 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 63A6D90E25193F3B00BD9198 /* Cocoa.framework */,
+ );
+ name = Frameworks;
+ sourceTree = "";
+ };
+ 63A6D91025193F3B00BD9198 /* KeePassXC-Browser Extension */ = {
+ isa = PBXGroup;
+ children = (
+ 63A6D91E25193F3B00BD9198 /* Resources */,
+ 63A6D91125193F3B00BD9198 /* SafariWebExtensionHandler.swift */,
+ 63A6D91325193F3B00BD9198 /* Info.plist */,
+ 63A6D91425193F3B00BD9198 /* KeePassXC_Browser_Extension.entitlements */,
+ );
+ path = "KeePassXC-Browser Extension";
+ sourceTree = "";
+ };
+ 63A6D91E25193F3B00BD9198 /* Resources */ = {
+ isa = PBXGroup;
+ children = (
+ 632F583D280BED1000BF1247 /* _locales */,
+ 632F5841280BED1100BF1247 /* background */,
+ 632F583E280BED1000BF1247 /* bootstrap */,
+ 632F583F280BED1000BF1247 /* common */,
+ 632F583C280BED1000BF1247 /* content */,
+ 632F583B280BED1000BF1247 /* css */,
+ 632F5840280BED1100BF1247 /* fonts */,
+ 632F5842280BED1100BF1247 /* icons */,
+ 632F5843280BED1100BF1247 /* manifest.json */,
+ 632F5838280BED1000BF1247 /* options */,
+ 632F583A280BED1000BF1247 /* popups */,
+ );
+ name = Resources;
+ path = "KeePassXC-Browser Extension";
+ sourceTree = SOURCE_ROOT;
+ };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+ 63A6D8F625193F3A00BD9198 /* KeePassXC-Browser */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 63A6D91B25193F3B00BD9198 /* Build configuration list for PBXNativeTarget "KeePassXC-Browser" */;
+ buildPhases = (
+ 63A6D8F325193F3A00BD9198 /* Sources */,
+ 63A6D8F425193F3A00BD9198 /* Frameworks */,
+ 63A6D8F525193F3A00BD9198 /* Resources */,
+ 63A6D91A25193F3B00BD9198 /* Embed App Extensions */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 63A6D90C25193F3B00BD9198 /* PBXTargetDependency */,
+ );
+ name = "KeePassXC-Browser";
+ productName = "KeePassXC-Browser";
+ productReference = 63A6D8F725193F3A00BD9198 /* KeePassXC-Browser.app */;
+ productType = "com.apple.product-type.application";
+ };
+ 63A6D90825193F3B00BD9198 /* KeePassXC-Browser Extension */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 63A6D91725193F3B00BD9198 /* Build configuration list for PBXNativeTarget "KeePassXC-Browser Extension" */;
+ buildPhases = (
+ 63A6D90525193F3B00BD9198 /* Sources */,
+ 63A6D90625193F3B00BD9198 /* Frameworks */,
+ 63A6D90725193F3B00BD9198 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = "KeePassXC-Browser Extension";
+ productName = "KeePassXC-Browser Extension";
+ productReference = 63A6D90925193F3B00BD9198 /* KeePassXC-Browser Extension.appex */;
+ productType = "com.apple.product-type.app-extension";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 63A6D8EF25193F3A00BD9198 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastSwiftUpdateCheck = 1200;
+ LastUpgradeCheck = 1200;
+ TargetAttributes = {
+ 63A6D8F625193F3A00BD9198 = {
+ CreatedOnToolsVersion = 12.0;
+ };
+ 63A6D90825193F3B00BD9198 = {
+ CreatedOnToolsVersion = 12.0;
+ };
+ };
+ };
+ buildConfigurationList = 63A6D8F225193F3A00BD9198 /* Build configuration list for PBXProject "KeePassXC-Browser" */;
+ compatibilityVersion = "Xcode 12.0";
+ developmentRegion = en;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ Base,
+ );
+ mainGroup = 63A6D8EE25193F3A00BD9198;
+ productRefGroup = 63A6D8F825193F3A00BD9198 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 63A6D8F625193F3A00BD9198 /* KeePassXC-Browser */,
+ 63A6D90825193F3B00BD9198 /* KeePassXC-Browser Extension */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 63A6D8F525193F3A00BD9198 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63A6D90325193F3A00BD9198 /* Assets.xcassets in Resources */,
+ 63A6D8FF25193F3A00BD9198 /* Main.storyboard in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 63A6D90725193F3B00BD9198 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 632F584E280BED1100BF1247 /* icons in Resources */,
+ 632F5849280BED1100BF1247 /* _locales in Resources */,
+ 632F584A280BED1100BF1247 /* bootstrap in Resources */,
+ 632F5847280BED1100BF1247 /* css in Resources */,
+ 632F584F280BED1100BF1247 /* manifest.json in Resources */,
+ 632F5844280BED1100BF1247 /* options in Resources */,
+ 632F584D280BED1100BF1247 /* background in Resources */,
+ 632F5846280BED1100BF1247 /* popups in Resources */,
+ 632F584C280BED1100BF1247 /* fonts in Resources */,
+ 632F5848280BED1100BF1247 /* content in Resources */,
+ 632F584B280BED1100BF1247 /* common in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 63A6D8F325193F3A00BD9198 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63A6D90125193F3A00BD9198 /* ViewController.swift in Sources */,
+ 63A6D8FC25193F3A00BD9198 /* AppDelegate.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 63A6D90525193F3B00BD9198 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 63A6D91225193F3B00BD9198 /* SafariWebExtensionHandler.swift in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 63A6D90C25193F3B00BD9198 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 63A6D90825193F3B00BD9198 /* KeePassXC-Browser Extension */;
+ targetProxy = 63A6D90B25193F3B00BD9198 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 63A6D8FD25193F3A00BD9198 /* Main.storyboard */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 63A6D8FE25193F3A00BD9198 /* Base */,
+ );
+ name = Main.storyboard;
+ sourceTree = "";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 63A6D91525193F3B00BD9198 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = dwarf;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ ENABLE_TESTABILITY = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+ SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+ };
+ name = Debug;
+ };
+ 63A6D91625193F3B00BD9198 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ CLANG_ANALYZER_NONNULL = YES;
+ CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_MODULES = YES;
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_ENABLE_OBJC_WEAK = YES;
+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+ CLANG_WARN_BOOL_CONVERSION = YES;
+ CLANG_WARN_COMMA = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+ CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+ CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INFINITE_RECURSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+ CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+ CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+ CLANG_WARN_STRICT_PROTOTYPES = YES;
+ CLANG_WARN_SUSPICIOUS_MOVE = YES;
+ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+ CLANG_WARN_UNREACHABLE_CODE = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ ENABLE_NS_ASSERTIONS = NO;
+ ENABLE_STRICT_OBJC_MSGSEND = YES;
+ GCC_C_LANGUAGE_STANDARD = gnu11;
+ GCC_NO_COMMON_BLOCKS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+ GCC_WARN_UNDECLARED_SELECTOR = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+ GCC_WARN_UNUSED_FUNCTION = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MTL_ENABLE_DEBUG_INFO = NO;
+ MTL_FAST_MATH = YES;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ SWIFT_COMPILATION_MODE = wholemodule;
+ SWIFT_OPTIMIZATION_LEVEL = "-O";
+ };
+ name = Release;
+ };
+ 63A6D91825193F3B00BD9198 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_ENTITLEMENTS = "KeePassXC-Browser Extension/KeePassXC_Browser_Extension.entitlements";
+ CODE_SIGN_STYLE = Automatic;
+ INFOPLIST_FILE = "KeePassXC-Browser Extension/Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ "@executable_path/../../../../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MARKETING_VERSION = 1.7.2;
+ PRODUCT_BUNDLE_IDENTIFIER = "com.keepassxc.KeePassXC-Browser-Extension";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
+ 63A6D91925193F3B00BD9198 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ CODE_SIGN_ENTITLEMENTS = "KeePassXC-Browser Extension/KeePassXC_Browser_Extension.entitlements";
+ CODE_SIGN_STYLE = Automatic;
+ INFOPLIST_FILE = "KeePassXC-Browser Extension/Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ "@executable_path/../../../../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MARKETING_VERSION = 1.7.2;
+ PRODUCT_BUNDLE_IDENTIFIER = "com.keepassxc.KeePassXC-Browser-Extension";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SKIP_INSTALL = YES;
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
+ 63A6D91C25193F3B00BD9198 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+ CODE_SIGN_ENTITLEMENTS = "KeePassXC-Browser/KeePassXC_Browser.entitlements";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ INFOPLIST_FILE = "KeePassXC-Browser/Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MARKETING_VERSION = 1.7.2;
+ PRODUCT_BUNDLE_IDENTIFIER = "com.keepassxc.KeePassXC-Browser";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Debug;
+ };
+ 63A6D91D25193F3B00BD9198 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
+ CODE_SIGN_ENTITLEMENTS = "KeePassXC-Browser/KeePassXC_Browser.entitlements";
+ CODE_SIGN_STYLE = Automatic;
+ COMBINE_HIDPI_IMAGES = YES;
+ INFOPLIST_FILE = "KeePassXC-Browser/Info.plist";
+ LD_RUNPATH_SEARCH_PATHS = (
+ "$(inherited)",
+ "@executable_path/../Frameworks",
+ );
+ MACOSX_DEPLOYMENT_TARGET = 10.15;
+ MARKETING_VERSION = 1.7.2;
+ PRODUCT_BUNDLE_IDENTIFIER = "com.keepassxc.KeePassXC-Browser";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ SWIFT_VERSION = 5.0;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 63A6D8F225193F3A00BD9198 /* Build configuration list for PBXProject "KeePassXC-Browser" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 63A6D91525193F3B00BD9198 /* Debug */,
+ 63A6D91625193F3B00BD9198 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 63A6D91725193F3B00BD9198 /* Build configuration list for PBXNativeTarget "KeePassXC-Browser Extension" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 63A6D91825193F3B00BD9198 /* Debug */,
+ 63A6D91925193F3B00BD9198 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 63A6D91B25193F3B00BD9198 /* Build configuration list for PBXNativeTarget "KeePassXC-Browser" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 63A6D91C25193F3B00BD9198 /* Debug */,
+ 63A6D91D25193F3B00BD9198 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 63A6D8EF25193F3A00BD9198 /* Project object */;
+}
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644
index 00000000..919434a6
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.xcworkspace/contents.xcworkspacedata
@@ -0,0 +1,7 @@
+
+
+
+
+
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644
index 00000000..18d98100
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
@@ -0,0 +1,8 @@
+
+
+
+
+ IDEDidComputeMac32BitWarning
+
+
+
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/xcshareddata/xcschemes/KeePassXC-Browser.xcscheme b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/xcshareddata/xcschemes/KeePassXC-Browser.xcscheme
new file mode 100644
index 00000000..b8e4028e
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser.xcodeproj/xcshareddata/xcschemes/KeePassXC-Browser.xcscheme
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/AppDelegate.swift b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/AppDelegate.swift
new file mode 100644
index 00000000..b3b34c91
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/AppDelegate.swift
@@ -0,0 +1,26 @@
+//
+// AppDelegate.swift
+// KeePassXC-Browser
+//
+// Created by varjolintu on 21.9.2020.
+//
+
+import Cocoa
+import os.log
+
+@NSApplicationMain
+class AppDelegate: NSObject, NSApplicationDelegate {
+
+ func applicationDidFinishLaunching(_ aNotification: Notification) {
+ // Insert code here to initialize your application
+ }
+
+ func applicationWillTerminate(_ aNotification: Notification) {
+ // Insert code here to tear down your application
+ }
+
+ func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool
+ {
+ return true;
+ }
+}
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AccentColor.colorset/Contents.json b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AccentColor.colorset/Contents.json
new file mode 100644
index 00000000..eb878970
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AccentColor.colorset/Contents.json
@@ -0,0 +1,11 @@
+{
+ "colors" : [
+ {
+ "idiom" : "universal"
+ }
+ ],
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/Contents.json b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/Contents.json
new file mode 100644
index 00000000..bd9b1799
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/Contents.json
@@ -0,0 +1,61 @@
+{
+ "images" : [
+ {
+ "size" : "16x16",
+ "idiom" : "mac",
+ "filename" : "keepassxc_16x16.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "16x16"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "1x",
+ "size" : "32x32"
+ },
+ {
+ "size" : "32x32",
+ "idiom" : "mac",
+ "filename" : "keepassxc_64x64.png",
+ "scale" : "2x"
+ },
+ {
+ "size" : "128x128",
+ "idiom" : "mac",
+ "filename" : "keepassxc_128x128.png",
+ "scale" : "1x"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "128x128"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "1x",
+ "size" : "256x256"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "256x256"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "1x",
+ "size" : "512x512"
+ },
+ {
+ "idiom" : "mac",
+ "scale" : "2x",
+ "size" : "512x512"
+ }
+ ],
+ "info" : {
+ "version" : 1,
+ "author" : "xcode"
+ }
+}
\ No newline at end of file
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_128x128.png b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_128x128.png
new file mode 100644
index 00000000..69b0fe24
Binary files /dev/null and b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_128x128.png differ
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_16x16.png b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_16x16.png
new file mode 100644
index 00000000..2164f033
Binary files /dev/null and b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_16x16.png differ
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_64x64.png b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_64x64.png
new file mode 100644
index 00000000..8ade0e85
Binary files /dev/null and b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/AppIcon.appiconset/keepassxc_64x64.png differ
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/Contents.json b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/Contents.json
new file mode 100644
index 00000000..73c00596
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Assets.xcassets/Contents.json
@@ -0,0 +1,6 @@
+{
+ "info" : {
+ "author" : "xcode",
+ "version" : 1
+ }
+}
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Base.lproj/Main.storyboard b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Base.lproj/Main.storyboard
new file mode 100644
index 00000000..ea128347
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Base.lproj/Main.storyboard
@@ -0,0 +1,169 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Info.plist b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Info.plist
new file mode 100644
index 00000000..e70ed144
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/Info.plist
@@ -0,0 +1,30 @@
+
+
+
+
+ CFBundleDevelopmentRegion
+ $(DEVELOPMENT_LANGUAGE)
+ CFBundleExecutable
+ $(EXECUTABLE_NAME)
+ CFBundleIconFile
+
+ CFBundleIdentifier
+ $(PRODUCT_BUNDLE_IDENTIFIER)
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ $(PRODUCT_NAME)
+ CFBundlePackageType
+ $(PRODUCT_BUNDLE_PACKAGE_TYPE)
+ CFBundleShortVersionString
+ $(MARKETING_VERSION)
+ CFBundleVersion
+ 1
+ LSMinimumSystemVersion
+ $(MACOSX_DEPLOYMENT_TARGET)
+ NSMainStoryboardFile
+ Main
+ NSPrincipalClass
+ NSApplication
+
+
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/KeePassXC_Browser.entitlements b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/KeePassXC_Browser.entitlements
new file mode 100644
index 00000000..625af03d
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/KeePassXC_Browser.entitlements
@@ -0,0 +1,12 @@
+
+
+
+
+ com.apple.security.app-sandbox
+
+ com.apple.security.files.user-selected.read-only
+
+ com.apple.security.network.client
+
+
+
diff --git a/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/ViewController.swift b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/ViewController.swift
new file mode 100644
index 00000000..92d62565
--- /dev/null
+++ b/keepassxc-browser-safari/KeePassXC-Browser/KeePassXC-Browser/ViewController.swift
@@ -0,0 +1,51 @@
+//
+// ViewController.swift
+// KeePassXC-Browser
+//
+// Created by varjolintu on 21.9.2020.
+//
+
+import Cocoa
+import SafariServices.SFSafariApplication
+import SafariServices.SFSafariExtensionManager
+import os.log
+
+let appName = "KeePassXC-Browser"
+let extensionBundleIdentifier = "com.keepassxc.KeePassXC-Browser-Extension"
+
+class ViewController: NSViewController {
+
+ @IBOutlet var appNameLabel: NSTextField!
+
+ override func viewDidLoad() {
+ super.viewDidLoad()
+ self.appNameLabel.stringValue = appName
+ SFSafariExtensionManager.getStateOfSafariExtension(withIdentifier: extensionBundleIdentifier) { (state, error) in
+ guard let state = state, error == nil else {
+ // Insert code to inform the user that something went wrong.
+ return
+ }
+
+ DispatchQueue.main.async {
+ if (state.isEnabled) {
+ self.appNameLabel.stringValue = "\(appName)'s extension is currently on."
+ } else {
+ self.appNameLabel.stringValue = "\(appName)'s extension is currently off. You can turn it on in Safari Extensions preferences."
+ }
+ }
+ }
+ }
+
+ @IBAction func openSafariExtensionPreferences(_ sender: AnyObject?) {
+ SFSafariApplication.showPreferencesForExtension(withIdentifier: extensionBundleIdentifier) { error in
+ guard error == nil else {
+ // Insert code to inform the user that something went wrong.
+ return
+ }
+
+ DispatchQueue.main.async {
+ NSApplication.shared.terminate(nil)
+ }
+ }
+ }
+}
diff --git a/keepassxc-browser/background/client.js b/keepassxc-browser/background/client.js
index 95537027..44533b48 100644
--- a/keepassxc-browser/background/client.js
+++ b/keepassxc-browser/background/client.js
@@ -104,7 +104,7 @@ keepassClient.sendNativeMessage = function(request, enableTimeout = false, timeo
const messageTimeout = timeoutValue || keepassClient.messageTimeout;
// Handle timeouts
- if (enableTimeout) {
+ if (!keepass.isSafari && enableTimeout) {
timeout = setTimeout(() => {
const errorMessage = {
action: requestAction,
@@ -121,8 +121,12 @@ keepassClient.sendNativeMessage = function(request, enableTimeout = false, timeo
messageBuffer.addMessage(request);
// Send the request
- if (keepassClient.nativePort) {
- keepassClient.nativePort.postMessage(request);
+ if (keepass.isSafari) {
+ chrome.runtime.sendNativeMessage(keepass.nativeHostName, { message: JSON.stringify(request) }, function(response) {
+ resolve(JSON.parse(response));
+ });
+ } else if (keepass.nativePort) {
+ keepass.nativePort.postMessage(request);
}
});
};
diff --git a/keepassxc-browser/background/keepass.js b/keepassxc-browser/background/keepass.js
index 0e8f1b2f..07706504 100755
--- a/keepassxc-browser/background/keepass.js
+++ b/keepassxc-browser/background/keepass.js
@@ -18,6 +18,7 @@ keepass.previousDatabaseHash = '';
keepass.keyId = 'keepassxc-browser-cryptokey-name';
keepass.keyBody = 'keepassxc-browser-key';
keepass.reconnectLoop = null;
+keepass.isSafari = isSafari();
const kpActions = {
SET_LOGIN: 'set-login',
diff --git a/keepassxc-browser/common/global.js b/keepassxc-browser/common/global.js
index 77301502..36477f0f 100755
--- a/keepassxc-browser/common/global.js
+++ b/keepassxc-browser/common/global.js
@@ -32,6 +32,11 @@ const isEdge = function() {
return navigator.userAgent.indexOf('Edg') !== -1;
};
+const isSafari = function() {
+ return navigator.userAgent.indexOf('Safari') !== -1
+ && (navigator.userAgent.indexOf('Chrome') === -1 || navigator.userAgent.indexOf('Chromium') === -1);
+};
+
const showNotification = function(message) {
browser.notifications.create({
'type': 'basic',
diff --git a/keepassxc-browser/options/options.js b/keepassxc-browser/options/options.js
index 8b777d9b..66f980ab 100644
--- a/keepassxc-browser/options/options.js
+++ b/keepassxc-browser/options/options.js
@@ -697,6 +697,11 @@ const getBrowserId = function() {
startPos = navigator.userAgent.indexOf('/', startPos) + 1;
const version = navigator.userAgent.substring(startPos, navigator.userAgent.indexOf('Safari'));
return 'Chrome/Chromium ' + version;
+ } else if (navigator.userAgent.indexOf('Safari') > -1) {
+ let startPos = navigator.userAgent.indexOf('Version');
+ startPos = navigator.userAgent.indexOf('/', startPos) + 1;
+ const version = navigator.userAgent.substring(startPos, navigator.userAgent.indexOf('Safari'));
+ return 'Safari ' + version;
}
return 'Other/Unknown';