Add support for Safari browser via WebSocket connection method
2
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
.DS_Store
|
||||
.idea
|
||||
|
||||
*.swp
|
||||
|
|
@ -11,3 +12,4 @@
|
|||
.xz
|
||||
node_modules
|
||||
test-results
|
||||
xcuserdata/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>NSExtension</key>
|
||||
<dict>
|
||||
<key>NSExtensionPointIdentifier</key>
|
||||
<string>com.apple.Safari.web-extension</string>
|
||||
<key>NSExtensionPrincipalClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).SafariWebExtensionHandler</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
//
|
||||
// SafariWebExtensionHandler.swift
|
||||
// KeePassXC-Browser Extension
|
||||
//
|
||||
// Created by varjolintu on 12.12.2025.
|
||||
//
|
||||
|
||||
import SafariServices
|
||||
import os.log
|
||||
|
||||
class SafariWebExtensionHandler: NSObject, NSExtensionRequestHandling {
|
||||
|
||||
func beginRequest(with context: NSExtensionContext) {
|
||||
let request = context.inputItems.first as? NSExtensionItem
|
||||
|
||||
let profile: UUID?
|
||||
if #available(iOS 17.0, macOS 14.0, *) {
|
||||
profile = request?.userInfo?[SFExtensionProfileKey] as? UUID
|
||||
} else {
|
||||
profile = request?.userInfo?["profile"] as? UUID
|
||||
}
|
||||
|
||||
let message: Any?
|
||||
if #available(iOS 15.0, macOS 11.0, *) {
|
||||
message = request?.userInfo?[SFExtensionMessageKey]
|
||||
} else {
|
||||
message = request?.userInfo?["message"]
|
||||
}
|
||||
|
||||
os_log(.default, "Received message from browser.runtime.sendNativeMessage: %@ (profile: %@)", String(describing: message), profile?.uuidString ?? "none")
|
||||
|
||||
let response = NSExtensionItem()
|
||||
if #available(iOS 15.0, macOS 11.0, *) {
|
||||
response.userInfo = [ SFExtensionMessageKey: [ "echo": message ] ]
|
||||
} else {
|
||||
response.userInfo = [ "message": [ "echo": message ] ]
|
||||
}
|
||||
|
||||
context.completeRequest(returningItems: [ response ], completionHandler: nil)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,645 @@
|
|||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 77;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
6325CAC52EEC98E200E3BCF2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6325CAC42EEC98E200E3BCF2 /* AppDelegate.swift */; };
|
||||
6325CAC92EEC98E200E3BCF2 /* Main.html in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAC72EEC98E200E3BCF2 /* Main.html */; };
|
||||
6325CACB2EEC98E200E3BCF2 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 6325CACA2EEC98E200E3BCF2 /* Icon.png */; };
|
||||
6325CACD2EEC98E200E3BCF2 /* Style.css in Resources */ = {isa = PBXBuildFile; fileRef = 6325CACC2EEC98E200E3BCF2 /* Style.css */; };
|
||||
6325CACF2EEC98E200E3BCF2 /* Script.js in Resources */ = {isa = PBXBuildFile; fileRef = 6325CACE2EEC98E200E3BCF2 /* Script.js */; };
|
||||
6325CAD12EEC98E200E3BCF2 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6325CAD02EEC98E200E3BCF2 /* ViewController.swift */; };
|
||||
6325CAD42EEC98E200E3BCF2 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAD22EEC98E200E3BCF2 /* Main.storyboard */; };
|
||||
6325CAD62EEC98E300E3BCF2 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAD52EEC98E300E3BCF2 /* Assets.xcassets */; };
|
||||
6325CADD2EEC98E300E3BCF2 /* KeePassXC-Browser Extension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 6325CADC2EEC98E300E3BCF2 /* KeePassXC-Browser Extension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
|
||||
6325CAE22EEC98E300E3BCF2 /* SafariWebExtensionHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6325CAE12EEC98E300E3BCF2 /* SafariWebExtensionHandler.swift */; };
|
||||
6325CAFB2EEC98E300E3BCF2 /* background in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAEE2EEC98E300E3BCF2 /* background */; };
|
||||
6325CAFC2EEC98E300E3BCF2 /* offscreen in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAEF2EEC98E300E3BCF2 /* offscreen */; };
|
||||
6325CAFD2EEC98E300E3BCF2 /* options in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF02EEC98E300E3BCF2 /* options */; };
|
||||
6325CAFE2EEC98E300E3BCF2 /* bootstrap in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF12EEC98E300E3BCF2 /* bootstrap */; };
|
||||
6325CAFF2EEC98E300E3BCF2 /* css in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF22EEC98E300E3BCF2 /* css */; };
|
||||
6325CB002EEC98E300E3BCF2 /* content in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF32EEC98E300E3BCF2 /* content */; };
|
||||
6325CB012EEC98E300E3BCF2 /* managed_storage.json in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF42EEC98E300E3BCF2 /* managed_storage.json */; };
|
||||
6325CB022EEC98E300E3BCF2 /* common in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF52EEC98E300E3BCF2 /* common */; };
|
||||
6325CB032EEC98E300E3BCF2 /* popups in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF62EEC98E300E3BCF2 /* popups */; };
|
||||
6325CB042EEC98E300E3BCF2 /* icons in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF72EEC98E300E3BCF2 /* icons */; };
|
||||
6325CB052EEC98E300E3BCF2 /* manifest.json in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF82EEC98E300E3BCF2 /* manifest.json */; };
|
||||
6325CB062EEC98E300E3BCF2 /* _locales in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAF92EEC98E300E3BCF2 /* _locales */; };
|
||||
6325CB072EEC98E300E3BCF2 /* fonts in Resources */ = {isa = PBXBuildFile; fileRef = 6325CAFA2EEC98E300E3BCF2 /* fonts */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
6325CADE2EEC98E300E3BCF2 /* PBXContainerItemProxy */ = {
|
||||
isa = PBXContainerItemProxy;
|
||||
containerPortal = 6325CAB92EEC98E200E3BCF2 /* Project object */;
|
||||
proxyType = 1;
|
||||
remoteGlobalIDString = 6325CADB2EEC98E300E3BCF2;
|
||||
remoteInfo = "KeePassXC-Browser Extension";
|
||||
};
|
||||
/* End PBXContainerItemProxy section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
6325CAE92EEC98E300E3BCF2 /* Embed Foundation Extensions */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 13;
|
||||
files = (
|
||||
6325CADD2EEC98E300E3BCF2 /* KeePassXC-Browser Extension.appex in Embed Foundation Extensions */,
|
||||
);
|
||||
name = "Embed Foundation Extensions";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
6325CAC12EEC98E200E3BCF2 /* KeePassXC-Browser.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "KeePassXC-Browser.app"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6325CAC42EEC98E200E3BCF2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
6325CAC82EEC98E200E3BCF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.html; name = Base; path = Base.lproj/Main.html; sourceTree = "<group>"; };
|
||||
6325CACA2EEC98E200E3BCF2 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
|
||||
6325CACC2EEC98E200E3BCF2 /* Style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = Style.css; sourceTree = "<group>"; };
|
||||
6325CACE2EEC98E200E3BCF2 /* Script.js */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.javascript; path = Script.js; sourceTree = "<group>"; };
|
||||
6325CAD02EEC98E200E3BCF2 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
6325CAD32EEC98E200E3BCF2 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
6325CAD52EEC98E300E3BCF2 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
6325CAD72EEC98E300E3BCF2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
6325CADC2EEC98E300E3BCF2 /* KeePassXC-Browser Extension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = "KeePassXC-Browser Extension.appex"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
6325CAE12EEC98E300E3BCF2 /* SafariWebExtensionHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SafariWebExtensionHandler.swift; sourceTree = "<group>"; };
|
||||
6325CAE32EEC98E300E3BCF2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
6325CAEE2EEC98E300E3BCF2 /* background */ = {isa = PBXFileReference; lastKnownFileType = folder; name = background; path = "../../../keepassxc-browser/background"; sourceTree = "<group>"; };
|
||||
6325CAEF2EEC98E300E3BCF2 /* offscreen */ = {isa = PBXFileReference; lastKnownFileType = folder; name = offscreen; path = "../../../keepassxc-browser/offscreen"; sourceTree = "<group>"; };
|
||||
6325CAF02EEC98E300E3BCF2 /* options */ = {isa = PBXFileReference; lastKnownFileType = folder; name = options; path = "../../../keepassxc-browser/options"; sourceTree = "<group>"; };
|
||||
6325CAF12EEC98E300E3BCF2 /* bootstrap */ = {isa = PBXFileReference; lastKnownFileType = folder; name = bootstrap; path = "../../../keepassxc-browser/bootstrap"; sourceTree = "<group>"; };
|
||||
6325CAF22EEC98E300E3BCF2 /* css */ = {isa = PBXFileReference; lastKnownFileType = folder; name = css; path = "../../../keepassxc-browser/css"; sourceTree = "<group>"; };
|
||||
6325CAF32EEC98E300E3BCF2 /* content */ = {isa = PBXFileReference; lastKnownFileType = folder; name = content; path = "../../../keepassxc-browser/content"; sourceTree = "<group>"; };
|
||||
6325CAF42EEC98E300E3BCF2 /* managed_storage.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = managed_storage.json; path = "../../../keepassxc-browser/managed_storage.json"; sourceTree = "<group>"; };
|
||||
6325CAF52EEC98E300E3BCF2 /* common */ = {isa = PBXFileReference; lastKnownFileType = folder; name = common; path = "../../../keepassxc-browser/common"; sourceTree = "<group>"; };
|
||||
6325CAF62EEC98E300E3BCF2 /* popups */ = {isa = PBXFileReference; lastKnownFileType = folder; name = popups; path = "../../../keepassxc-browser/popups"; sourceTree = "<group>"; };
|
||||
6325CAF72EEC98E300E3BCF2 /* icons */ = {isa = PBXFileReference; lastKnownFileType = folder; name = icons; path = "../../../keepassxc-browser/icons"; sourceTree = "<group>"; };
|
||||
6325CAF82EEC98E300E3BCF2 /* manifest.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; name = manifest.json; path = "../../../keepassxc-browser/manifest.json"; sourceTree = "<group>"; };
|
||||
6325CAF92EEC98E300E3BCF2 /* _locales */ = {isa = PBXFileReference; lastKnownFileType = folder; name = _locales; path = "../../../keepassxc-browser/_locales"; sourceTree = "<group>"; };
|
||||
6325CAFA2EEC98E300E3BCF2 /* fonts */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fonts; path = "../../../keepassxc-browser/fonts"; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
6325CABE2EEC98E200E3BCF2 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
6325CAD92EEC98E300E3BCF2 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
6325CAB82EEC98E200E3BCF2 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6325CAC32EEC98E200E3BCF2 /* KeePassXC-Browser */,
|
||||
6325CAE02EEC98E300E3BCF2 /* KeePassXC-Browser Extension */,
|
||||
6325CAC22EEC98E200E3BCF2 /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6325CAC22EEC98E200E3BCF2 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6325CAC12EEC98E200E3BCF2 /* KeePassXC-Browser.app */,
|
||||
6325CADC2EEC98E300E3BCF2 /* KeePassXC-Browser Extension.appex */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6325CAC32EEC98E200E3BCF2 /* KeePassXC-Browser */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6325CAC42EEC98E200E3BCF2 /* AppDelegate.swift */,
|
||||
6325CAD02EEC98E200E3BCF2 /* ViewController.swift */,
|
||||
6325CAD22EEC98E200E3BCF2 /* Main.storyboard */,
|
||||
6325CAD52EEC98E300E3BCF2 /* Assets.xcassets */,
|
||||
6325CAD72EEC98E300E3BCF2 /* Info.plist */,
|
||||
6325CAC62EEC98E200E3BCF2 /* Resources */,
|
||||
);
|
||||
path = "KeePassXC-Browser";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6325CAC62EEC98E200E3BCF2 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6325CAC72EEC98E200E3BCF2 /* Main.html */,
|
||||
6325CACA2EEC98E200E3BCF2 /* Icon.png */,
|
||||
6325CACC2EEC98E200E3BCF2 /* Style.css */,
|
||||
6325CACE2EEC98E200E3BCF2 /* Script.js */,
|
||||
);
|
||||
path = Resources;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6325CAE02EEC98E300E3BCF2 /* KeePassXC-Browser Extension */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6325CAED2EEC98E300E3BCF2 /* Resources */,
|
||||
6325CAE12EEC98E300E3BCF2 /* SafariWebExtensionHandler.swift */,
|
||||
6325CAE32EEC98E300E3BCF2 /* Info.plist */,
|
||||
);
|
||||
path = "KeePassXC-Browser Extension";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6325CAED2EEC98E300E3BCF2 /* Resources */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
6325CAEE2EEC98E300E3BCF2 /* background */,
|
||||
6325CAEF2EEC98E300E3BCF2 /* offscreen */,
|
||||
6325CAF02EEC98E300E3BCF2 /* options */,
|
||||
6325CAF12EEC98E300E3BCF2 /* bootstrap */,
|
||||
6325CAF22EEC98E300E3BCF2 /* css */,
|
||||
6325CAF32EEC98E300E3BCF2 /* content */,
|
||||
6325CAF42EEC98E300E3BCF2 /* managed_storage.json */,
|
||||
6325CAF52EEC98E300E3BCF2 /* common */,
|
||||
6325CAF62EEC98E300E3BCF2 /* popups */,
|
||||
6325CAF72EEC98E300E3BCF2 /* icons */,
|
||||
6325CAF82EEC98E300E3BCF2 /* manifest.json */,
|
||||
6325CAF92EEC98E300E3BCF2 /* _locales */,
|
||||
6325CAFA2EEC98E300E3BCF2 /* fonts */,
|
||||
);
|
||||
name = Resources;
|
||||
path = "KeePassXC-Browser Extension";
|
||||
sourceTree = SOURCE_ROOT;
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
6325CAC02EEC98E200E3BCF2 /* KeePassXC-Browser */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 6325CAEA2EEC98E300E3BCF2 /* Build configuration list for PBXNativeTarget "KeePassXC-Browser" */;
|
||||
buildPhases = (
|
||||
6325CABD2EEC98E200E3BCF2 /* Sources */,
|
||||
6325CABE2EEC98E200E3BCF2 /* Frameworks */,
|
||||
6325CABF2EEC98E200E3BCF2 /* Resources */,
|
||||
6325CAE92EEC98E300E3BCF2 /* Embed Foundation Extensions */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
6325CADF2EEC98E300E3BCF2 /* PBXTargetDependency */,
|
||||
);
|
||||
name = "KeePassXC-Browser";
|
||||
packageProductDependencies = (
|
||||
);
|
||||
productName = "KeePassXC-Browser";
|
||||
productReference = 6325CAC12EEC98E200E3BCF2 /* KeePassXC-Browser.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
6325CADB2EEC98E300E3BCF2 /* KeePassXC-Browser Extension */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 6325CAE62EEC98E300E3BCF2 /* Build configuration list for PBXNativeTarget "KeePassXC-Browser Extension" */;
|
||||
buildPhases = (
|
||||
6325CAD82EEC98E300E3BCF2 /* Sources */,
|
||||
6325CAD92EEC98E300E3BCF2 /* Frameworks */,
|
||||
6325CADA2EEC98E300E3BCF2 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = "KeePassXC-Browser Extension";
|
||||
packageProductDependencies = (
|
||||
);
|
||||
productName = "KeePassXC-Browser Extension";
|
||||
productReference = 6325CADC2EEC98E300E3BCF2 /* KeePassXC-Browser Extension.appex */;
|
||||
productType = "com.apple.product-type.app-extension";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
6325CAB92EEC98E200E3BCF2 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = 1;
|
||||
LastSwiftUpdateCheck = 2610;
|
||||
LastUpgradeCheck = 2610;
|
||||
TargetAttributes = {
|
||||
6325CAC02EEC98E200E3BCF2 = {
|
||||
CreatedOnToolsVersion = 26.1.1;
|
||||
};
|
||||
6325CADB2EEC98E300E3BCF2 = {
|
||||
CreatedOnToolsVersion = 26.1.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = 6325CABC2EEC98E200E3BCF2 /* Build configuration list for PBXProject "KeePassXC-Browser" */;
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = 6325CAB82EEC98E200E3BCF2;
|
||||
minimizedProjectReferenceProxies = 1;
|
||||
preferredProjectObjectVersion = 77;
|
||||
productRefGroup = 6325CAC22EEC98E200E3BCF2 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
6325CAC02EEC98E200E3BCF2 /* KeePassXC-Browser */,
|
||||
6325CADB2EEC98E300E3BCF2 /* KeePassXC-Browser Extension */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
6325CABF2EEC98E200E3BCF2 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6325CACB2EEC98E200E3BCF2 /* Icon.png in Resources */,
|
||||
6325CAD42EEC98E200E3BCF2 /* Main.storyboard in Resources */,
|
||||
6325CACF2EEC98E200E3BCF2 /* Script.js in Resources */,
|
||||
6325CAC92EEC98E200E3BCF2 /* Main.html in Resources */,
|
||||
6325CAD62EEC98E300E3BCF2 /* Assets.xcassets in Resources */,
|
||||
6325CACD2EEC98E200E3BCF2 /* Style.css in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
6325CADA2EEC98E300E3BCF2 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6325CB002EEC98E300E3BCF2 /* content in Resources */,
|
||||
6325CB072EEC98E300E3BCF2 /* fonts in Resources */,
|
||||
6325CAFF2EEC98E300E3BCF2 /* css in Resources */,
|
||||
6325CAFD2EEC98E300E3BCF2 /* options in Resources */,
|
||||
6325CB042EEC98E300E3BCF2 /* icons in Resources */,
|
||||
6325CAFC2EEC98E300E3BCF2 /* offscreen in Resources */,
|
||||
6325CB052EEC98E300E3BCF2 /* manifest.json in Resources */,
|
||||
6325CB062EEC98E300E3BCF2 /* _locales in Resources */,
|
||||
6325CAFB2EEC98E300E3BCF2 /* background in Resources */,
|
||||
6325CB032EEC98E300E3BCF2 /* popups in Resources */,
|
||||
6325CB012EEC98E300E3BCF2 /* managed_storage.json in Resources */,
|
||||
6325CAFE2EEC98E300E3BCF2 /* bootstrap in Resources */,
|
||||
6325CB022EEC98E300E3BCF2 /* common in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
6325CABD2EEC98E200E3BCF2 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6325CAD12EEC98E200E3BCF2 /* ViewController.swift in Sources */,
|
||||
6325CAC52EEC98E200E3BCF2 /* AppDelegate.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
6325CAD82EEC98E300E3BCF2 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
6325CAE22EEC98E300E3BCF2 /* SafariWebExtensionHandler.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
6325CADF2EEC98E300E3BCF2 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 6325CADB2EEC98E300E3BCF2 /* KeePassXC-Browser Extension */;
|
||||
targetProxy = 6325CADE2EEC98E300E3BCF2 /* PBXContainerItemProxy */;
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
6325CAC72EEC98E200E3BCF2 /* Main.html */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6325CAC82EEC98E200E3BCF2 /* Base */,
|
||||
);
|
||||
name = Main.html;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
6325CAD22EEC98E200E3BCF2 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
6325CAD32EEC98E200E3BCF2 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
6325CAE42EEC98E300E3BCF2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
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;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||
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;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 26.1;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
6325CAE52EEC98E300E3BCF2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
|
||||
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;
|
||||
ENABLE_USER_SCRIPT_SANDBOXING = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu17;
|
||||
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;
|
||||
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 26.1;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = macosx;
|
||||
SWIFT_COMPILATION_MODE = wholemodule;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
6325CAE72EEC98E300E3BCF2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
ENABLE_APP_SANDBOX = YES;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_USER_SELECTED_FILES = readonly;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "KeePassXC-Browser Extension/Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "KeePassXC-Browser Extension";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@executable_path/../../../../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SafariServices,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.keepassxc.KeePassXC-Browser.Extension";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
6325CAE82EEC98E300E3BCF2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
ENABLE_APP_SANDBOX = YES;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_USER_SELECTED_FILES = readonly;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "KeePassXC-Browser Extension/Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "KeePassXC-Browser Extension";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
"@executable_path/../../../../Frameworks",
|
||||
);
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.14;
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SafariServices,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.keepassxc.KeePassXC-Browser.Extension";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SKIP_INSTALL = YES;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
6325CAEB2EEC98E300E3BCF2 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
ENABLE_APP_SANDBOX = YES;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
|
||||
ENABLE_USER_SELECTED_FILES = readonly;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "KeePassXC-Browser/Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "KeePassXC-Browser";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
INFOPLIST_KEY_NSMainStoryboardFile = Main;
|
||||
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SafariServices,
|
||||
"-framework",
|
||||
WebKit,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.keepassxc.KeePassXC-Browser";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
REGISTER_APP_GROUPS = YES;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
6325CAEC2EEC98E300E3BCF2 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
CURRENT_PROJECT_VERSION = 1;
|
||||
ENABLE_APP_SANDBOX = YES;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
ENABLE_OUTGOING_NETWORK_CONNECTIONS = YES;
|
||||
ENABLE_USER_SELECTED_FILES = readonly;
|
||||
GENERATE_INFOPLIST_FILE = YES;
|
||||
INFOPLIST_FILE = "KeePassXC-Browser/Info.plist";
|
||||
INFOPLIST_KEY_CFBundleDisplayName = "KeePassXC-Browser";
|
||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||
INFOPLIST_KEY_NSMainStoryboardFile = Main;
|
||||
INFOPLIST_KEY_NSPrincipalClass = NSApplication;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/../Frameworks",
|
||||
);
|
||||
MARKETING_VERSION = 1.0;
|
||||
OTHER_LDFLAGS = (
|
||||
"-framework",
|
||||
SafariServices,
|
||||
"-framework",
|
||||
WebKit,
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "org.keepassxc.KeePassXC-Browser";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
REGISTER_APP_GROUPS = YES;
|
||||
STRING_CATALOG_GENERATE_SYMBOLS = YES;
|
||||
SWIFT_APPROACHABLE_CONCURRENCY = YES;
|
||||
SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor;
|
||||
SWIFT_EMIT_LOC_STRINGS = YES;
|
||||
SWIFT_UPCOMING_FEATURE_MEMBER_IMPORT_VISIBILITY = YES;
|
||||
SWIFT_VERSION = 5.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
6325CABC2EEC98E200E3BCF2 /* Build configuration list for PBXProject "KeePassXC-Browser" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
6325CAE42EEC98E300E3BCF2 /* Debug */,
|
||||
6325CAE52EEC98E300E3BCF2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
6325CAE62EEC98E300E3BCF2 /* Build configuration list for PBXNativeTarget "KeePassXC-Browser Extension" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
6325CAE72EEC98E300E3BCF2 /* Debug */,
|
||||
6325CAE82EEC98E300E3BCF2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
6325CAEA2EEC98E300E3BCF2 /* Build configuration list for PBXNativeTarget "KeePassXC-Browser" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
6325CAEB2EEC98E300E3BCF2 /* Debug */,
|
||||
6325CAEC2EEC98E300E3BCF2 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 6325CAB92EEC98E200E3BCF2 /* Project object */;
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
//
|
||||
// AppDelegate.swift
|
||||
// KeePassXC-Browser
|
||||
//
|
||||
// Created by varjolintu on 12.12.2025.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
@main
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
// Override point for customization after application launch.
|
||||
}
|
||||
|
||||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"colors" : [
|
||||
{
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-16@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "16x16",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-16@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-32@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "32x32",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-32@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-128@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "128x128",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-128@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-256@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "256x256",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-256@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-512@1x.png",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"size" : "512x512",
|
||||
"idiom" : "mac",
|
||||
"filename" : "mac-icon-512@2x.png",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 774 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 82 KiB |
|
After Width: | Height: | Size: 247 KiB |
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="19085" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19085"/>
|
||||
<plugIn identifier="com.apple.WebKit2IBPlugin" version="19085"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Application-->
|
||||
<scene sceneID="JPo-4y-FX3">
|
||||
<objects>
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="KeePassXC-Browser" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="KeePassXC-Browser" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About KeePassXC-Browser" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Hide KeePassXC-Browser" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit KeePassXC-Browser" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Help" id="wpr-3q-Mcd">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
|
||||
<items>
|
||||
<menuItem title="KeePassXC-Browser Help" keyEquivalent="?" id="FKE-Sm-Kum">
|
||||
<connections>
|
||||
<action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
||||
</connections>
|
||||
</application>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider="target"/>
|
||||
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
|
||||
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="76" y="-134"/>
|
||||
</scene>
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="R2V-B0-nI4">
|
||||
<objects>
|
||||
<windowController showSeguePresentationStyle="single" id="B8D-0N-5wS" sceneMemberID="viewController">
|
||||
<window key="window" title="KeePassXC-Browser" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" animationBehavior="default" id="IQv-IB-iLA">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
|
||||
<windowCollectionBehavior key="collectionBehavior" fullScreenNone="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="425" height="325"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
|
||||
</connections>
|
||||
</window>
|
||||
<connections>
|
||||
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
|
||||
</connections>
|
||||
</windowController>
|
||||
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="250"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" id="m2S-Jp-Qdl">
|
||||
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<wkWebView wantsLayer="YES" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="eOr-cG-IQY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="425" height="325"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<wkWebViewConfiguration key="configuration">
|
||||
<audiovisualMediaTypes key="mediaTypesRequiringUserActionForPlayback" none="YES"/>
|
||||
<wkPreferences key="preferences"/>
|
||||
</wkWebViewConfiguration>
|
||||
</wkWebView>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="webView" destination="eOr-cG-IQY" id="GFe-mU-dBY"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="655"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SFSafariWebExtensionConverterVersion</key>
|
||||
<string>26.1.1</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src 'self'">
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
|
||||
<link rel="stylesheet" href="../Style.css">
|
||||
<script src="../Script.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<img src="../Icon.png" width="128" height="128" alt="KeePassXC-Browser Icon">
|
||||
<p class="state-unknown">You can turn on KeePassXC-Browser’s extension in Safari Extensions preferences.</p>
|
||||
<p class="state-on">KeePassXC-Browser’s extension is currently on. You can turn it off in Safari Extensions preferences.</p>
|
||||
<p class="state-off">KeePassXC-Browser’s extension is currently off. You can turn it on in Safari Extensions preferences.</p>
|
||||
<button class="open-preferences">Quit and Open Safari Extensions Preferences…</button>
|
||||
</body>
|
||||
</html>
|
||||
|
After Width: | Height: | Size: 11 KiB |
|
|
@ -0,0 +1,22 @@
|
|||
function show(enabled, useSettingsInsteadOfPreferences) {
|
||||
if (useSettingsInsteadOfPreferences) {
|
||||
document.getElementsByClassName('state-on')[0].innerText = "KeePassXC-Browser’s extension is currently on. You can turn it off in the Extensions section of Safari Settings.";
|
||||
document.getElementsByClassName('state-off')[0].innerText = "KeePassXC-Browser’s extension is currently off. You can turn it on in the Extensions section of Safari Settings.";
|
||||
document.getElementsByClassName('state-unknown')[0].innerText = "You can turn on KeePassXC-Browser’s extension in the Extensions section of Safari Settings.";
|
||||
document.getElementsByClassName('open-preferences')[0].innerText = "Quit and Open Safari Settings…";
|
||||
}
|
||||
|
||||
if (typeof enabled === "boolean") {
|
||||
document.body.classList.toggle(`state-on`, enabled);
|
||||
document.body.classList.toggle(`state-off`, !enabled);
|
||||
} else {
|
||||
document.body.classList.remove(`state-on`);
|
||||
document.body.classList.remove(`state-off`);
|
||||
}
|
||||
}
|
||||
|
||||
function openPreferences() {
|
||||
webkit.messageHandlers.controller.postMessage("open-preferences");
|
||||
}
|
||||
|
||||
document.querySelector("button.open-preferences").addEventListener("click", openPreferences);
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
* {
|
||||
-webkit-user-select: none;
|
||||
-webkit-user-drag: none;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
:root {
|
||||
color-scheme: light dark;
|
||||
|
||||
--spacing: 20px;
|
||||
}
|
||||
|
||||
html {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
|
||||
gap: var(--spacing);
|
||||
margin: 0 calc(var(--spacing) * 2);
|
||||
height: 100%;
|
||||
|
||||
font: -apple-system-short-body;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body:not(.state-on, .state-off) :is(.state-on, .state-off) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.state-on :is(.state-off, .state-unknown) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
body.state-off :is(.state-on, .state-unknown) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
//
|
||||
// ViewController.swift
|
||||
// KeePassXC-Browser
|
||||
//
|
||||
// Created by varjolintu on 12.12.2025.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
import SafariServices
|
||||
import WebKit
|
||||
|
||||
let extensionBundleIdentifier = "org.keepassxc.KeePassXC-Browser.Extension"
|
||||
|
||||
class ViewController: NSViewController, WKNavigationDelegate, WKScriptMessageHandler {
|
||||
|
||||
@IBOutlet var webView: WKWebView!
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
self.webView.navigationDelegate = self
|
||||
|
||||
self.webView.configuration.userContentController.add(self, name: "controller")
|
||||
|
||||
self.webView.loadFileURL(Bundle.main.url(forResource: "Main", withExtension: "html")!, allowingReadAccessTo: Bundle.main.resourceURL!)
|
||||
}
|
||||
|
||||
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
|
||||
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 #available(macOS 13, *) {
|
||||
webView.evaluateJavaScript("show(\(state.isEnabled), true)")
|
||||
} else {
|
||||
webView.evaluateJavaScript("show(\(state.isEnabled), false)")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func userContentController(_ userContentController: WKUserContentController, didReceive message: WKScriptMessage) {
|
||||
if (message.body as! String != "open-preferences") {
|
||||
return;
|
||||
}
|
||||
|
||||
SFSafariApplication.showPreferencesForExtension(withIdentifier: extensionBundleIdentifier) { error in
|
||||
DispatchQueue.main.async {
|
||||
NSApplication.shared.terminate(nil)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -870,6 +870,22 @@
|
|||
"message": "Allow filling HTTP Basic Auth credentials",
|
||||
"description": "Allow filling HTTP Basic Auth credentials checkbox text."
|
||||
},
|
||||
"optionsConnectionMethod": {
|
||||
"message": "Connection method",
|
||||
"description": "Connection method selection text."
|
||||
},
|
||||
"optionsConnectionMethodHelpText": {
|
||||
"message": "If native messaging is blocked in your browser, you can switch to a direct WebSocket sonnection. The feature must be enabled from KeePassXC side to work. Browser restart is required.",
|
||||
"description": "Connection method help text."
|
||||
},
|
||||
"optionsConnectionMethodNativeMessaging": {
|
||||
"message": "Native messaging",
|
||||
"description": "Native messaging option for Connection method."
|
||||
},
|
||||
"optionsConnectionMethodWebSocket": {
|
||||
"message": "WebSocket",
|
||||
"description": "WebSocket option for Connection method."
|
||||
},
|
||||
"optionsDebugLogging": {
|
||||
"message": "Debug logging",
|
||||
"description": "Debug logging checkbox text."
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ browserAction.generateIconName = async function(iconType) {
|
|||
style = page.settings.colorTheme;
|
||||
}
|
||||
}
|
||||
const filetype = page.isFirefox ? 'svg' : 'png';
|
||||
const filetype = (page.isFirefox || page.isSafari) ? 'svg' : 'png';
|
||||
return `/icons/toolbar/${style}/${name}.${filetype}`;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ keepassClient.keySize = 24;
|
|||
keepassClient.messageTimeout = 500; // Milliseconds
|
||||
keepassClient.nativeHostName = 'org.keepassxc.keepassxc_browser';
|
||||
keepassClient.nativePort = null;
|
||||
keepassClient.webSocket = null;
|
||||
|
||||
const kpErrors = {
|
||||
UNKNOWN_ERROR: 0,
|
||||
|
|
@ -157,7 +158,10 @@ class Message {
|
|||
//--------------------------------------------------------------------------
|
||||
|
||||
keepassClient.sendNativeMessage = async function(request, enableTimeout = false, timeoutValue) {
|
||||
if (!keepassClient.nativePort) {
|
||||
if (page?.settings?.connectionMethod === ConnectionMethod.WEBSOCKET && !keepassClient.webSocket) {
|
||||
logError('No WebSocket defined.');
|
||||
return;
|
||||
} else if (page?.settings?.connectionMethod === ConnectionMethod.NATIVE_MESSAGING && !keepassClient.nativePort) {
|
||||
logError('No native messaging port defined.');
|
||||
return;
|
||||
}
|
||||
|
|
@ -167,7 +171,11 @@ keepassClient.sendNativeMessage = async function(request, enableTimeout = false,
|
|||
messageBuffer.addMessage(message);
|
||||
});
|
||||
|
||||
keepassClient.nativePort.postMessage(request);
|
||||
if (page.isSafari || page?.settings?.connectionMethod === ConnectionMethod.WEBSOCKET) {
|
||||
keepassClient.webSocket.send(JSON.stringify(request));
|
||||
} else {
|
||||
keepassClient.nativePort.postMessage(request);
|
||||
}
|
||||
|
||||
const response = await message.promise;
|
||||
|
||||
|
|
@ -400,7 +408,7 @@ function onDisconnected() {
|
|||
page.clearAllLogins();
|
||||
keepass.updatePopup('cross');
|
||||
keepass.updateDatabaseHashToContent();
|
||||
logError(`Failed to connect: ${(browser.runtime.lastError === null ? 'Unknown error' : browser.runtime.lastError.message)}`);
|
||||
logError(`Failed to connect: ${(browser.runtime.lastError === null ? 'Unknown error' : browser.runtime.lastError?.message)}`);
|
||||
}
|
||||
|
||||
keepassClient.onNativeMessage = function(response) {
|
||||
|
|
@ -413,3 +421,42 @@ keepassClient.onNativeMessage = function(response) {
|
|||
// Generic response handling
|
||||
keepassClient.handleNativeMessage(response);
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// WebSocket related
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
keepassClient.connectToWebSocket = async function() {
|
||||
return new Promise((resolve, reject) => {
|
||||
if (keepassClient.webSocket) {
|
||||
keepassClient.webSocket.close();
|
||||
}
|
||||
|
||||
console.log(`${EXTENSION_NAME}: Connecting to WebSocket`);
|
||||
|
||||
try {
|
||||
keepassClient.webSocket = new WebSocket('ws://localhost:7580');
|
||||
keepassClient.webSocket.addEventListener('close', (event) => {
|
||||
logError('Close WebSocket:', event);
|
||||
onDisconnected();
|
||||
reject();
|
||||
});
|
||||
keepassClient.webSocket.addEventListener('error', (event) => {
|
||||
logError('WebSocket error:', event);
|
||||
onDisconnected();
|
||||
reject();
|
||||
});
|
||||
keepassClient.webSocket.addEventListener('message', (event) => {
|
||||
keepassClient.onNativeMessage(JSON.parse(event?.data));
|
||||
});
|
||||
keepassClient.webSocket.addEventListener('open', (event) => {
|
||||
console.log(`${EXTENSION_NAME}: WebSocket connected`);
|
||||
keepass.isConnected = true;
|
||||
resolve();
|
||||
});
|
||||
} catch (e) {
|
||||
keepassClient.webSocket = null;
|
||||
onDisconnected();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ httpAuth.requests = [];
|
|||
httpAuth.pendingCallbacks = [];
|
||||
|
||||
httpAuth.init = function() {
|
||||
if (page.isSafari) {
|
||||
return;
|
||||
}
|
||||
|
||||
let handleReq = httpAuth.handleRequestPromise;
|
||||
let reqType = 'blocking';
|
||||
|
||||
|
|
|
|||
|
|
@ -805,7 +805,12 @@ keepass.disableAutomaticReconnect = function() {
|
|||
};
|
||||
|
||||
keepass.reconnect = async function(tab = null, connectionTimeout = 1500) {
|
||||
keepassClient.connectToNative();
|
||||
if (page?.settings?.connectionMethod === ConnectionMethod.WEBSOCKET) {
|
||||
await keepassClient.connectToWebSocket();
|
||||
} else {
|
||||
keepassClient.connectToNative();
|
||||
}
|
||||
|
||||
keepass.generateNewKeyPair();
|
||||
const keyChangeResult = await keepass.changePublicKeys(tab, !!connectionTimeout, connectionTimeout).catch(() => false);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
'use strict';
|
||||
|
||||
const ConnectionMethod = {
|
||||
NATIVE_MESSAGING: 'nativemessaging',
|
||||
WEBSOCKET: 'websocket',
|
||||
};
|
||||
|
||||
const defaultSettings = {
|
||||
afterFillSorting: SORT_BY_MATCHING_CREDENTIALS_SETTING,
|
||||
afterFillSortingTotp: SORT_BY_RELEVANT_ENTRY,
|
||||
|
|
@ -15,6 +20,7 @@ const defaultSettings = {
|
|||
checkUpdateKeePassXC: CHECK_UPDATE_NEVER,
|
||||
clearCredentialsTimeout: 10,
|
||||
colorTheme: 'system',
|
||||
connectionMethod: isSafari() ? ConnectionMethod.WEBSOCKET : ConnectionMethod.NATIVE_MESSAGING,
|
||||
credentialSorting: SORT_BY_GROUP_AND_TITLE,
|
||||
debugLogging: false,
|
||||
defaultGroup: '',
|
||||
|
|
@ -50,6 +56,7 @@ page.clearCredentialsTimeout = null;
|
|||
page.currentRequest = {};
|
||||
page.currentTabId = -1;
|
||||
page.isFirefox = false;
|
||||
page.isSafari = false;
|
||||
page.manualFill = ManualFill.NONE;
|
||||
page.menuContexts = [ 'editable' ];
|
||||
page.passwordFilled = false;
|
||||
|
|
@ -68,6 +75,7 @@ page.initBrowser = async function() {
|
|||
navigator.userAgent.indexOf('Firefox') !== -1
|
||||
|| navigator.userAgent.indexOf('Gecko/') !== -1
|
||||
|| typeof browser.runtime.getBrowserInfo === 'function';
|
||||
page.isSafari = isSafari();
|
||||
};
|
||||
|
||||
page.initSettings = async function() {
|
||||
|
|
@ -75,25 +83,27 @@ page.initSettings = async function() {
|
|||
const item = await browser.storage.local.get({ 'settings': {} });
|
||||
|
||||
// Load managed settings if found
|
||||
if (page.isFirefox && typeof(browser.storage.managed) === 'object') {
|
||||
try {
|
||||
const managedSettings = await browser.storage.managed.get('settings');
|
||||
if (managedSettings?.settings) {
|
||||
debugLogMessage('Managed settings found.');
|
||||
item.settings = managedSettings.settings;
|
||||
if (!page.isSafari) {
|
||||
if (page.isFirefox && typeof(browser.storage.managed) === 'object') {
|
||||
try {
|
||||
const managedSettings = await browser.storage.managed.get('settings');
|
||||
if (managedSettings?.settings) {
|
||||
debugLogMessage('Managed settings found.');
|
||||
item.settings = managedSettings.settings;
|
||||
}
|
||||
} catch (err) {
|
||||
debugLogMessage('page.initSettings: ' + err);
|
||||
}
|
||||
} catch (err) {
|
||||
debugLogMessage('page.initSettings: ' + err);
|
||||
} else if (typeof chrome.storage.managed === 'object') {
|
||||
chrome.storage.managed.get('settings').then((managedSettings) => {
|
||||
if (managedSettings?.settings) {
|
||||
debugLogMessage('Managed settings found.');
|
||||
item.settings = managedSettings.settings;
|
||||
}
|
||||
}).catch((err) => {
|
||||
debugLogMessage('page.initSettings: ' + err);
|
||||
});
|
||||
}
|
||||
} else if (typeof chrome.storage.managed === 'object') {
|
||||
chrome.storage.managed.get('settings').then((managedSettings) => {
|
||||
if (managedSettings?.settings) {
|
||||
debugLogMessage('Managed settings found.');
|
||||
item.settings = managedSettings.settings;
|
||||
}
|
||||
}).catch((err) => {
|
||||
debugLogMessage('page.initSettings: ' + err);
|
||||
});
|
||||
}
|
||||
|
||||
page.settings = item.settings;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,12 @@ 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',
|
||||
|
|
|
|||
|
|
@ -62,7 +62,9 @@ kpxcBanner.create = async function(credentials = {}) {
|
|||
const bannerInfo = kpxcUI.createElement('div', 'banner-info');
|
||||
const bannerButtons = kpxcUI.createElement('div', 'banner-buttons');
|
||||
|
||||
const className = kpxc.isFirefox ? 'kpxc-banner-icon-moz' : 'kpxc-banner-icon';
|
||||
const className = isSafari()
|
||||
? 'kpxc-banner-icon-safari'
|
||||
: kpxc.isFirefox ? 'kpxc-banner-icon-moz' : 'kpxc-banner-icon';
|
||||
const icon = kpxcUI.createElement('span', className, { 'alt': 'logo' });
|
||||
|
||||
const infoText = kpxcUI.createElement('span', 'banner-info-text', {}, tr('rememberInfoText'));
|
||||
|
|
|
|||
|
|
@ -93,7 +93,9 @@ kpxcCustomLoginFieldsBanner.create = async function() {
|
|||
const bannerInfo = kpxcUI.createElement('div', 'banner-info');
|
||||
const bannerButtons = kpxcUI.createElement('div', 'banner-buttons');
|
||||
|
||||
const iconClassName = kpxc.isFirefox ? 'kpxc-banner-icon-moz' : 'kpxc-banner-icon';
|
||||
const iconClassName = isSafari()
|
||||
? 'kpxc-banner-icon-safari'
|
||||
: kpxc.isFirefox ? 'kpxc-banner-icon-moz' : 'kpxc-banner-icon';
|
||||
const icon = kpxcUI.createElement('span', iconClassName);
|
||||
const infoText = kpxcUI.createElement('span', 'banner-info-text', {}, tr('defineChooseCustomLoginFieldText'));
|
||||
const separator = kpxcUI.createElement('div', 'kpxc-separator');
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ PasswordIcon.prototype.initField = function(field) {
|
|||
};
|
||||
|
||||
PasswordIcon.prototype.createIcon = function(field) {
|
||||
const className = kpxc.isFirefox ? 'key-moz' : 'key';
|
||||
const className = isSafari() ? 'key-safari' : kpxc.isFirefox ? 'key-moz' : 'key';
|
||||
const size = this.calculateIconSize(field);
|
||||
|
||||
const icon = kpxcUI.createElement('div', 'kpxc kpxc-pwgen-icon ' + className,
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ TOTPFieldIcon.prototype.initField = async function(field, segmented) {
|
|||
};
|
||||
|
||||
TOTPFieldIcon.prototype.createIcon = function(field, segmented = false) {
|
||||
const className = kpxc.isFirefox ? 'moz' : 'default';
|
||||
const className = isSafari() ? 'safari' : kpxc.isFirefox ? 'moz' : 'default';
|
||||
const size = this.calculateIconSize(field);
|
||||
|
||||
const icon = kpxcUI.createElement('div', 'kpxc kpxc-totp-icon ' + className,
|
||||
|
|
|
|||
|
|
@ -369,7 +369,9 @@ kpxcUI.createNotification = async function(type, message) {
|
|||
const notification = kpxcUI.createElement('div', 'kpxc-notification kpxc-notification-' + type, {});
|
||||
type = type.charAt(0).toUpperCase() + type.slice(1) + '!';
|
||||
|
||||
const className = kpxc.isFirefox ? 'kpxc-banner-icon-moz' : 'kpxc-banner-icon';
|
||||
const className = isSafari()
|
||||
? 'kpxc-banner-icon-safari'
|
||||
: kpxc.isFirefox ? 'kpxc-banner-icon-moz' : 'kpxc-banner-icon';
|
||||
const icon = kpxcUI.createElement('span', className, { 'alt': 'logo' });
|
||||
const label = kpxcUI.createElement('span', 'kpxc-label', {}, type);
|
||||
const msg = kpxcUI.createElement('span', '', {}, message);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ class UsernameFieldIcon extends Icon {
|
|||
this.observer.disconnect();
|
||||
}
|
||||
|
||||
this.icon.classList.remove('lock', 'lock-moz', 'unlock', 'unlock-moz', 'disconnected', 'disconnected-moz');
|
||||
this.icon.classList.remove('lock', 'lock-moz', 'lock-safari', 'unlock', 'unlock-moz', 'unlock-safari',
|
||||
'disconnected', 'disconnected-moz', 'disconnected-safari');
|
||||
this.icon.classList.add(getIconClassName(state));
|
||||
this.icon.title = getIconText(state);
|
||||
|
||||
|
|
@ -147,12 +148,12 @@ const iconClicked = async function(field, icon) {
|
|||
|
||||
const getIconClassName = function(state = DatabaseState.UNLOCKED) {
|
||||
if (state === DatabaseState.LOCKED) {
|
||||
return kpxc.isFirefox ? 'lock-moz' : 'lock';
|
||||
return isSafari() ? 'lock-safari' : kpxc.isFirefox ? 'lock-moz' : 'lock';
|
||||
} else if (state === DatabaseState.DISCONNECTED) {
|
||||
return kpxc.isFirefox ? 'disconnected-moz' : 'disconnected';
|
||||
return isSafari() ? 'disconnected-safari' : kpxc.isFirefox ? 'disconnected-moz' : 'disconnected';
|
||||
}
|
||||
|
||||
return kpxc.isFirefox ? 'unlock-moz' : 'unlock';
|
||||
return isSafari() ? 'unlock-safari' : kpxc.isFirefox ? 'unlock-moz' : 'unlock';
|
||||
};
|
||||
|
||||
const getIconText = function(state) {
|
||||
|
|
|
|||
|
|
@ -81,6 +81,14 @@ div.kpxc-banner .kpxc-banner-icon-moz {
|
|||
background-size: contain;
|
||||
}
|
||||
|
||||
div.kpxc-banner .kpxc-banner-icon-safari {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
overflow: hidden;
|
||||
background: url('safari-web-extension://__MSG_@@extension_id__/icons/keepassxc.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
div.kpxc-banner .kpxc-help-icon {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
@ -97,6 +105,14 @@ div.kpxc-banner .kpxc-help-icon-moz {
|
|||
background-size: contain;
|
||||
}
|
||||
|
||||
div.kpxc-banner .kpxc-help-icon-safari {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
overflow: hidden;
|
||||
background: url('safari-web-extension://__MSG_@@extension_id__/icons/help.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-separator {
|
||||
border-left: 1px solid #ccc;
|
||||
height: 100% !important;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,16 @@
|
|||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-notification .kpxc-banner-icon-safari {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 10px;
|
||||
margin-right: 4px;
|
||||
overflow: hidden;
|
||||
background: url('safari-web-extension://__MSG_@@extension_id__/icons/keepassxc.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-notification .kpxc-label {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,3 +14,8 @@
|
|||
background: url('moz-extension://__MSG_@@extension_id__/icons/key.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-pwgen-icon.key-safari {
|
||||
background: url('safari-web-extension://__MSG_@@extension_id__/icons/key.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,4 +13,9 @@
|
|||
.kpxc-totp-icon.moz {
|
||||
background: url('moz-extension://__MSG_@@extension_id__/icons/otp.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.kpxc-totp-icon.safari {
|
||||
background: url('safari-web-extension://__MSG_@@extension_id__/icons/otp.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@
|
|||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-username-icon.disconnected-safari {
|
||||
background: url('safari-web-extension://__MSG_@@extension_id__/icons/disconnected.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-username-icon.lock {
|
||||
background: url('chrome-extension://__MSG_@@extension_id__/icons/locked.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
|
|
@ -25,6 +30,11 @@
|
|||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-username-icon.lock-safari {
|
||||
background: url('safari-web-extension://__MSG_@@extension_id__/icons/locked.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-username-icon.unlock {
|
||||
background: url('chrome-extension://__MSG_@@extension_id__/icons/keepassxc.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
|
|
@ -34,3 +44,8 @@
|
|||
background: url('moz-extension://__MSG_@@extension_id__/icons/keepassxc.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
.kpxc-username-icon.unlock-safari {
|
||||
background: url('safari-web-extension://__MSG_@@extension_id__/icons/keepassxc.svg') right no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,10 @@ input:disabled {
|
|||
opacity: .3!important;
|
||||
}
|
||||
|
||||
select:disabled {
|
||||
opacity: .3!important;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: none;
|
||||
bottom: 1rem;
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Keyboard shortcuts -->
|
||||
<div class="card my-4 shadow">
|
||||
<div class="card my-4 shadow" id="keyboardShortcuts">
|
||||
<div class="card-header h6 rounded-0">
|
||||
<i class="fa fa-keyboard-o" aria-hidden="true"></i>
|
||||
<span data-i18n="optionsKeyboardShortcutsHeader"></span>
|
||||
|
|
@ -278,7 +278,7 @@
|
|||
</div>
|
||||
|
||||
<!-- Autofill HTTP Auth dialogs -->
|
||||
<div class="form-group pb-1">
|
||||
<div class="form-group pb-1" id="autoFillHttpAuth">
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" name="autoFillAndSend" id="autoFillAndSend" value="true">
|
||||
<label class="form-check-label" for="autoFillAndSend" data-i18n="optionsCheckboxAutoFillAndSend"></label>
|
||||
|
|
@ -531,6 +531,18 @@
|
|||
<div class="form-text" data-i18n="optionsClearCredentialsTimeoutHelpText"></div>
|
||||
</div>
|
||||
|
||||
<!-- Connection method -->
|
||||
<div class="form-group col-sm-3 pb-2 py-2">
|
||||
<label for="connectionMethod" class="form-label" data-i18n="optionsConnectionMethod"></label>
|
||||
<select class="form-select form-select-sm col-md-3 col-lg-2" id="connectionMethod" data-i18n="[title]optionsConnectionMethodSelection">
|
||||
<option value="nativemessaging" data-i18n="optionsConnectionMethodNativeMessaging"></option>
|
||||
<option value="websocket" data-i18n="optionsConnectionMethodWebSocket"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span class="form-text text-muted" data-i18n="optionsConnectionMethodHelpText"></span>
|
||||
</div>
|
||||
|
||||
<!-- Debug logging -->
|
||||
<div class="form-group mt-2 pb-1">
|
||||
<div class="form-check form-switch">
|
||||
|
|
|
|||
|
|
@ -226,6 +226,13 @@ options.initGeneralSettings = async function() {
|
|||
});
|
||||
});
|
||||
|
||||
// Connection method
|
||||
$('#tab-general-settings select#connectionMethod').value = options.settings['connectionMethod'];
|
||||
$('#tab-general-settings select#connectionMethod').addEventListener('change', async function(e) {
|
||||
options.settings['connectionMethod'] = e.currentTarget.value;
|
||||
await options.saveSettings();
|
||||
});
|
||||
|
||||
// Default group
|
||||
$('#defaultGroupButton').addEventListener('click', async function() {
|
||||
const value = $('#defaultGroup').value;
|
||||
|
|
@ -873,12 +880,21 @@ options.createWarning = function(elem, text) {
|
|||
}, 5000);
|
||||
};
|
||||
|
||||
options.hideUnsupportedFeatures = function() {
|
||||
if (isSafari()) {
|
||||
$('#tab-general-settings select#connectionMethod').disabled = true;
|
||||
$('#tab-general-settings div#keyboardShortcuts').hide();
|
||||
$('#tab-general-settings div#autoFillHttpAuth').hide();
|
||||
}
|
||||
};
|
||||
|
||||
const getBrowserId = function(userAgent) {
|
||||
const browserQueries = [
|
||||
{ findStr: 'Firefox', name: 'Mozilla Firefox' },
|
||||
{ findStr: 'Edg', name: 'Microsoft Edge' },
|
||||
{ findStr: 'OPR', name: 'Opera' },
|
||||
{ findStr: 'Chrome', name: 'Chrome/Chromium' }
|
||||
{ findStr: 'Chrome', name: 'Chrome/Chromium' },
|
||||
{ findStr: 'Version', name: 'Safari' }
|
||||
];
|
||||
|
||||
const getVersion = (agent, findStr) => {
|
||||
|
|
@ -991,6 +1007,7 @@ window.addEventListener('scroll', function() {
|
|||
options.initCustomLoginFields();
|
||||
options.initSitePreferences();
|
||||
options.initAbout();
|
||||
options.hideUnsupportedFeatures();
|
||||
} catch (err) {
|
||||
console.log('Error loading options page: ' + err);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -153,6 +153,15 @@ code {
|
|||
width: 2.5rem;
|
||||
}
|
||||
|
||||
#choose-custom-login-fields-button-safari {
|
||||
background-image: url('safari-web-extension://__MSG_@@extension_id__/icons/custom_login_fields.svg');
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
background-size: 70%;
|
||||
height: 31px;
|
||||
width: 2.5rem;
|
||||
}
|
||||
|
||||
#lock-database-button {
|
||||
display: none;
|
||||
width: 2.5rem;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ async function initSettings() {
|
|||
const isFirefox = await browser.runtime.sendMessage({ action: 'is_firefox' });
|
||||
if (isFirefox) {
|
||||
customLoginFieldsButton.id = 'choose-custom-login-fields-button-moz';
|
||||
} else if (isSafari()) {
|
||||
customLoginFieldsButton.id = 'choose-custom-login-fields-button-safari';
|
||||
}
|
||||
|
||||
customLoginFieldsButton.addEventListener('click', async () => {
|
||||
|
|
|
|||