Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Commit 4619ae7

Browse files
committed
Firefox support now working
1 parent 2581ef0 commit 4619ae7

File tree

7 files changed

+53
-7
lines changed

7 files changed

+53
-7
lines changed
Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Set-Location $PSScriptRoot
22

33
$HostPath = Resolve-Path ..\..\netcode.io.host\bin\Debug\netcode.io.host.exe
4-
$ManifestJsonPath = Resolve-Path manifest.windows.json
5-
$ManifestJson = @{
4+
$ManifestChromeJsonPath = "$(pwd)\manifest.windows.chrome.json"
5+
$ManifestChromeJson = @{
66
name = "netcode.io";
77
description = "netcode.io helper";
88
path = $HostPath.Path;
@@ -11,14 +11,27 @@ $ManifestJson = @{
1111
"chrome-extension://fkcdbgdmpjenlkecdjadcpnkchaecbpn/",
1212
"chrome-extension://hpecmifakhimhidjpcpjmihpacijicbd/"
1313
);
14+
}
15+
ConvertTo-Json $ManifestChromeJson | Out-File -Encoding UTF8 $ManifestChromeJsonPath
16+
$ManifestFirefoxJsonPath = "$(pwd)\manifest.windows.firefox.json"
17+
$ManifestFirefoxJson = @{
18+
name = "netcode.io";
19+
description = "netcode.io helper";
20+
path = $HostPath.Path;
21+
type = "stdio";
1422
allowed_extensions = @(
1523
"webext@netcode.redpoint.games"
1624
);
1725
}
18-
ConvertTo-Json $ManifestJson | Out-File -Encoding UTF8 $ManifestJsonPath
26+
ConvertTo-Json $ManifestFirefoxJson | Out-File -Encoding UTF8 $ManifestFirefoxJsonPath
1927

2028
$RegistryPath = "HKCU:\SOFTWARE\Google\Chrome\NativeMessagingHosts\netcode.io"
2129
if (!(Test-Path $RegistryPath)) {
2230
New-Item -ItemType Directory $RegistryPath
2331
}
24-
New-ItemProperty -Path $RegistryPath -Name "(Default)" -Value $ManifestJsonPath -Force | Out-Null
32+
New-ItemProperty -Path $RegistryPath -Name "(Default)" -Value $ManifestChromeJsonPath -Force | Out-Null
33+
$RegistryPath = "HKCU:\SOFTWARE\Mozilla\NativeMessagingHosts\netcode.io"
34+
if (!(Test-Path $RegistryPath)) {
35+
New-Item -ItemType Directory $RegistryPath
36+
}
37+
New-ItemProperty -Path $RegistryPath -Name "(Default)" -Value $ManifestFirefoxJsonPath -Force | Out-Null
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"path": "C:\\Users\\June\\Documents\\Projects\\netcode.io.host\\netcode.io.host\\bin\\Debug\\netcode.io.host.exe",
3+
"description": "netcode.io helper",
4+
"name": "netcode.io",
5+
"allowed_origins": [
6+
"chrome-extension://fkcdbgdmpjenlkecdjadcpnkchaecbpn/",
7+
"chrome-extension://hpecmifakhimhidjpcpjmihpacijicbd/"
8+
],
9+
"type": "stdio"
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"path": "C:\\Users\\June\\Documents\\Projects\\netcode.io.host\\netcode.io.host\\bin\\Debug\\netcode.io.host.exe",
3+
"description": "netcode.io helper",
4+
"name": "netcode.io",
5+
"allowed_extensions": [
6+
"webext@netcode.redpoint.games"
7+
],
8+
"type": "stdio"
9+
}
File renamed without changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"path": "netcode.io.host.exe",
3+
"description": "netcode.io helper",
4+
"name": "netcode.io",
5+
"allowed_origins": [
6+
"chrome-extension://fkcdbgdmpjenlkecdjadcpnkchaecbpn/",
7+
"chrome-extension://hpecmifakhimhidjpcpjmihpacijicbd/"
8+
],
9+
"allowed_extensions": [
10+
"webext@netcode.redpoint.games"
11+
],
12+
"type": "stdio"
13+
}

build/Build-Win32.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ if (Test-Path "C:\NuGet\nuget.exe") {
3737
& "C:\NuGet\nuget.exe" restore
3838
}
3939
& "C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" /m /p:Configuration=Release netcode.io.host.sln
40-
cp $root\browser\hostapp\manifest.windows.relative.json $root\netcode.io.host\bin\Release\manifest.windows.relative.json
40+
cp $root\browser\hostapp\manifest.windows.relative.chrome.json $root\netcode.io.host\bin\Release\manifest.windows.relative.chrome.json
41+
cp $root\browser\hostapp\manifest.windows.relative.firefox.json $root\netcode.io.host\bin\Release\manifest.windows.relative.firefox.json
4142

4243
echo "Packaging netcode.io helper..."
4344
if (Test-Path $root\netcode.io.wininstall\package.zip) {

netcode.io.wininstall/HelperForm.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ private void InstallNetcode()
5454
.CreateSubKey("Chrome")
5555
.CreateSubKey("NativeMessagingHosts")
5656
.CreateSubKey("netcode.io");
57-
registryKey.SetValue(null, Path.Combine(netcodePath, "manifest.windows.relative.json"));
57+
registryKey.SetValue(null, Path.Combine(netcodePath, "manifest.windows.relative.chrome.json"));
5858
registryKey = Registry.CurrentUser
5959
.CreateSubKey("Software")
6060
.CreateSubKey("Mozilla")
6161
.CreateSubKey("NativeMessagingHosts")
6262
.CreateSubKey("netcode.io");
63-
registryKey.SetValue(null, Path.Combine(netcodePath, "manifest.windows.relative.json"));
63+
registryKey.SetValue(null, Path.Combine(netcodePath, "manifest.windows.relative.firefox.json"));
6464

6565
Thread.Sleep(1000);
6666
}

0 commit comments

Comments
 (0)