Skip to content

Commit 4d73f0e

Browse files
committed
add microsoft edge (chromium), closes #41
1 parent d6a47a5 commit 4d73f0e

File tree

8 files changed

+101
-28
lines changed

8 files changed

+101
-28
lines changed

KeePassNatMsg/NativeMessaging/BrowserSelectForm.Designer.cs

Lines changed: 35 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KeePassNatMsg/NativeMessaging/BrowserSelectForm.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ public Browsers SelectedBrowsers
2222
if (chkChromium.Checked) b |= Browsers.Chromium;
2323
if (chkFirefox.Checked) b |= Browsers.Firefox;
2424
if (chkVivaldi.Checked) b |= Browsers.Vivaldi;
25+
if (chkMsEdge.Checked) b |= Browsers.Edge;
2526
return b;
2627
}
2728
}
2829

2930
private void btnOk_Click(object sender, System.EventArgs e)
3031
{
31-
if (chkChrome.Checked || chkChromium.Checked || chkFirefox.Checked || chkVivaldi.Checked)
32+
if (chkChrome.Checked || chkChromium.Checked || chkFirefox.Checked || chkVivaldi.Checked || chkMsEdge.Checked)
3233
{
3334
DialogResult = DialogResult.OK;
3435
Close();
@@ -61,6 +62,9 @@ private void BrowserSelectForm_Load(object sender, System.EventArgs e)
6162
case Browsers.Vivaldi:
6263
cb = chkVivaldi;
6364
break;
65+
case Browsers.Edge:
66+
cb = chkMsEdge;
67+
break;
6468
}
6569

6670
if (cb != null)

KeePassNatMsg/NativeMessaging/LinuxHost.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ public class LinuxHost : PosixHost
88
".config/google-chrome/NativeMessagingHosts",
99
".config/chromium/NativeMessagingHosts",
1010
".mozilla/native-messaging-hosts",
11-
".config/vivaldi/NativeMessagingHosts"
11+
".config/vivaldi/NativeMessagingHosts",
12+
".config/microsoft edge/NativeMessagingHosts",
1213
};
1314
}
1415
}

KeePassNatMsg/NativeMessaging/MacOsxHost.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ public class MacOsxHost : PosixHost
88
"Library/Application Support/Google/Chrome/NativeMessagingHosts",
99
"Library/Application Support/Chromium/NativeMessagingHosts",
1010
"Library/Application Support/Mozilla/NativeMessagingHosts",
11-
"Library/Application Support/Vivaldi/NativeMessagingHosts"
11+
"Library/Application Support/Vivaldi/NativeMessagingHosts",
12+
"Library/Application Support/Microsoft Edge/NativeMessagingHosts"
1213
};
1314
}
1415
}

KeePassNatMsg/NativeMessaging/NativeMessagingHost.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,16 @@ namespace KeePassNatMsg.NativeMessaging
1111
public enum Browsers
1212
{
1313
None,
14+
1415
[Description("Google Chrome")]
1516
Chrome,
17+
1618
Chromium,
1719
Firefox = 4,
18-
Vivaldi = 8
20+
Vivaldi = 8,
21+
22+
[Description("Microsoft Edge")]
23+
Edge = 16,
1924
}
2025

2126
public enum BrowserStatus
@@ -66,9 +71,11 @@ protected string GetJsonData(Browsers b)
6671
case Browsers.Chrome:
6772
case Browsers.Chromium:
6873
case Browsers.Vivaldi:
69-
return Properties.Resources.chrome_win;
74+
return Properties.Resources.chrome_json;
7075
case Browsers.Firefox:
71-
return Properties.Resources.firefox_win;
76+
return Properties.Resources.firefox_json;
77+
case Browsers.Edge:
78+
return Properties.Resources.edge_json;
7279
}
7380
return null;
7481
}

KeePassNatMsg/NativeMessaging/WindowsHost.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@ namespace KeePassNatMsg.NativeMessaging
77
{
88
public class WindowsHost : NativeMessagingHost
99
{
10-
private string[] RegKeys = new[] { string.Empty, "Software\\Google\\Chrome", "Software\\Chromium", "Software\\Mozilla", "Software\\Vivaldi" };
10+
private readonly string[] RegKeys = new[] {
11+
string.Empty,
12+
"Software\\Google\\Chrome",
13+
"Software\\Chromium",
14+
"Software\\Mozilla",
15+
"Software\\Vivaldi",
16+
"Software\\Microsoft\\Edge",
17+
};
1118

1219
public override string ProxyPath => Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "KeePassNatMsg");
1320

KeePassNatMsg/Properties/Resources.Designer.cs

Lines changed: 24 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

KeePassNatMsg/Properties/Resources.resx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
<resheader name="writer">
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120-
<data name="chrome_win" xml:space="preserve">
120+
<data name="chrome_json" xml:space="preserve">
121121
<value>{{
122122
"name": "org.keepassxc.keepassxc_browser",
123123
"description": "KeepassXC integration with Native Messaging support",
@@ -133,7 +133,20 @@
133133
<data name="earth_lock" type="System.Resources.ResXFileRef, System.Windows.Forms">
134134
<value>..\Resources\earth_lock.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
135135
</data>
136-
<data name="firefox_win" xml:space="preserve">
136+
<data name="edge_json" xml:space="preserve">
137+
<value>{{
138+
"name": "org.keepassxc.keepassxc_browser",
139+
"description": "KeepassXC integration with Native Messaging support",
140+
"path" : "{0}",
141+
"type": "stdio",
142+
"allowed_origins": [
143+
"chrome-extension://iopaggbpplllidnfmcghoonnokmjoicf/",
144+
"chrome-extension://oboonakemofpalcgghocfoadofidjkkk/",
145+
"chrome-extension://pdffhmdngciaglkoonimfcmckehcpafo/"
146+
]
147+
}}</value>
148+
</data>
149+
<data name="firefox_json" xml:space="preserve">
137150
<value>{{
138151
"name": "org.keepassxc.keepassxc_browser",
139152
"description": "KeepassXC integration with Firefox with Native Messaging support",

0 commit comments

Comments
 (0)