Skip to content

Commit

Permalink
add browser debug configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
myangelkamikaze committed Feb 16, 2024
1 parent a15c058 commit 8c35ebe
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 5 deletions.
11 changes: 11 additions & 0 deletions Browser/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"profiles": {
"Browser": {
"commandName": "Project"
},
"Browser debug": {
"commandName": "Project",
"commandLineArgs": "localhost\r\n45467"
}
}
}
21 changes: 21 additions & 0 deletions ElectronicObserver.sln
Original file line number Diff line number Diff line change
Expand Up @@ -33,50 +33,71 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElectronicObserver.Kancolle
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Browser Debug|x64 = Browser Debug|x64
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A9ABEC50-1BFC-4C69-87AE-C68DB6004F68}.Browser Debug|x64.ActiveCfg = Browser Debug|x64
{A9ABEC50-1BFC-4C69-87AE-C68DB6004F68}.Browser Debug|x64.Build.0 = Browser Debug|x64
{A9ABEC50-1BFC-4C69-87AE-C68DB6004F68}.Debug|x64.ActiveCfg = Debug|x64
{A9ABEC50-1BFC-4C69-87AE-C68DB6004F68}.Debug|x64.Build.0 = Debug|x64
{A9ABEC50-1BFC-4C69-87AE-C68DB6004F68}.Release|x64.ActiveCfg = Release|x64
{A9ABEC50-1BFC-4C69-87AE-C68DB6004F68}.Release|x64.Build.0 = Release|x64
{87A2B596-57D0-48BB-B522-895782D7A6FC}.Browser Debug|x64.ActiveCfg = Debug|x64
{87A2B596-57D0-48BB-B522-895782D7A6FC}.Debug|x64.ActiveCfg = Debug|x64
{87A2B596-57D0-48BB-B522-895782D7A6FC}.Debug|x64.Build.0 = Debug|x64
{87A2B596-57D0-48BB-B522-895782D7A6FC}.Release|x64.ActiveCfg = Release|x64
{87A2B596-57D0-48BB-B522-895782D7A6FC}.Release|x64.Build.0 = Release|x64
{CA2A3648-9C19-4CB7-8A17-754552823C26}.Browser Debug|x64.ActiveCfg = Debug|x64
{CA2A3648-9C19-4CB7-8A17-754552823C26}.Debug|x64.ActiveCfg = Debug|x64
{CA2A3648-9C19-4CB7-8A17-754552823C26}.Debug|x64.Build.0 = Debug|x64
{CA2A3648-9C19-4CB7-8A17-754552823C26}.Release|x64.ActiveCfg = Release|x64
{CA2A3648-9C19-4CB7-8A17-754552823C26}.Release|x64.Build.0 = Release|x64
{85325F04-7F84-4C81-B775-2FCB5827818C}.Browser Debug|x64.ActiveCfg = Debug|x64
{85325F04-7F84-4C81-B775-2FCB5827818C}.Browser Debug|x64.Build.0 = Debug|x64
{85325F04-7F84-4C81-B775-2FCB5827818C}.Debug|x64.ActiveCfg = Debug|x64
{85325F04-7F84-4C81-B775-2FCB5827818C}.Debug|x64.Build.0 = Debug|x64
{85325F04-7F84-4C81-B775-2FCB5827818C}.Release|x64.ActiveCfg = Release|x64
{85325F04-7F84-4C81-B775-2FCB5827818C}.Release|x64.Build.0 = Release|x64
{93519D27-F710-406F-9CAC-C4BC8698D50D}.Browser Debug|x64.ActiveCfg = Debug|Any CPU
{93519D27-F710-406F-9CAC-C4BC8698D50D}.Browser Debug|x64.Build.0 = Debug|Any CPU
{93519D27-F710-406F-9CAC-C4BC8698D50D}.Debug|x64.ActiveCfg = Debug|Any CPU
{93519D27-F710-406F-9CAC-C4BC8698D50D}.Debug|x64.Build.0 = Debug|Any CPU
{93519D27-F710-406F-9CAC-C4BC8698D50D}.Release|x64.ActiveCfg = Release|Any CPU
{93519D27-F710-406F-9CAC-C4BC8698D50D}.Release|x64.Build.0 = Release|Any CPU
{B5FFF803-DA98-4ED2-B38B-A2DBABD4D6A5}.Browser Debug|x64.ActiveCfg = Debug|Any CPU
{B5FFF803-DA98-4ED2-B38B-A2DBABD4D6A5}.Browser Debug|x64.Build.0 = Debug|Any CPU
{B5FFF803-DA98-4ED2-B38B-A2DBABD4D6A5}.Debug|x64.ActiveCfg = Debug|Any CPU
{B5FFF803-DA98-4ED2-B38B-A2DBABD4D6A5}.Debug|x64.Build.0 = Debug|Any CPU
{B5FFF803-DA98-4ED2-B38B-A2DBABD4D6A5}.Release|x64.ActiveCfg = Release|Any CPU
{B5FFF803-DA98-4ED2-B38B-A2DBABD4D6A5}.Release|x64.Build.0 = Release|Any CPU
{A3AAE51F-A61E-46ED-B84B-6F3AFD183BB5}.Browser Debug|x64.ActiveCfg = Debug|x64
{A3AAE51F-A61E-46ED-B84B-6F3AFD183BB5}.Browser Debug|x64.Build.0 = Debug|x64
{A3AAE51F-A61E-46ED-B84B-6F3AFD183BB5}.Debug|x64.ActiveCfg = Debug|x64
{A3AAE51F-A61E-46ED-B84B-6F3AFD183BB5}.Debug|x64.Build.0 = Debug|x64
{A3AAE51F-A61E-46ED-B84B-6F3AFD183BB5}.Release|x64.ActiveCfg = Release|x64
{A3AAE51F-A61E-46ED-B84B-6F3AFD183BB5}.Release|x64.Build.0 = Release|x64
{249AEFD1-9BFA-4BBD-9A46-0E3CF9CF99B6}.Browser Debug|x64.ActiveCfg = Debug|x64
{249AEFD1-9BFA-4BBD-9A46-0E3CF9CF99B6}.Browser Debug|x64.Build.0 = Debug|x64
{249AEFD1-9BFA-4BBD-9A46-0E3CF9CF99B6}.Debug|x64.ActiveCfg = Debug|x64
{249AEFD1-9BFA-4BBD-9A46-0E3CF9CF99B6}.Debug|x64.Build.0 = Debug|x64
{249AEFD1-9BFA-4BBD-9A46-0E3CF9CF99B6}.Release|x64.ActiveCfg = Release|x64
{249AEFD1-9BFA-4BBD-9A46-0E3CF9CF99B6}.Release|x64.Build.0 = Release|x64
{EED09122-C133-4195-8AFA-A2AB74BC06EA}.Browser Debug|x64.ActiveCfg = Debug|x64
{EED09122-C133-4195-8AFA-A2AB74BC06EA}.Browser Debug|x64.Build.0 = Debug|x64
{EED09122-C133-4195-8AFA-A2AB74BC06EA}.Debug|x64.ActiveCfg = Debug|x64
{EED09122-C133-4195-8AFA-A2AB74BC06EA}.Debug|x64.Build.0 = Debug|x64
{EED09122-C133-4195-8AFA-A2AB74BC06EA}.Release|x64.ActiveCfg = Release|x64
{EED09122-C133-4195-8AFA-A2AB74BC06EA}.Release|x64.Build.0 = Release|x64
{61B5D946-B3E5-45AE-91AB-55B061DA14FD}.Browser Debug|x64.ActiveCfg = Debug|Any CPU
{61B5D946-B3E5-45AE-91AB-55B061DA14FD}.Browser Debug|x64.Build.0 = Debug|Any CPU
{61B5D946-B3E5-45AE-91AB-55B061DA14FD}.Debug|x64.ActiveCfg = Debug|Any CPU
{61B5D946-B3E5-45AE-91AB-55B061DA14FD}.Debug|x64.Build.0 = Debug|Any CPU
{61B5D946-B3E5-45AE-91AB-55B061DA14FD}.Release|x64.ActiveCfg = Release|Any CPU
{61B5D946-B3E5-45AE-91AB-55B061DA14FD}.Release|x64.Build.0 = Release|Any CPU
{213BC50D-423A-4268-B826-B9154F946E70}.Browser Debug|x64.ActiveCfg = Debug|Any CPU
{213BC50D-423A-4268-B826-B9154F946E70}.Browser Debug|x64.Build.0 = Debug|Any CPU
{213BC50D-423A-4268-B826-B9154F946E70}.Debug|x64.ActiveCfg = Debug|Any CPU
{213BC50D-423A-4268-B826-B9154F946E70}.Debug|x64.Build.0 = Debug|Any CPU
{213BC50D-423A-4268-B826-B9154F946E70}.Release|x64.ActiveCfg = Release|Any CPU
Expand Down
1 change: 1 addition & 0 deletions ElectronicObserver/ElectronicObserver.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<LangVersion>preview</LangVersion>
<DebugType>embedded</DebugType>
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
<Configurations>Debug;Release;Browser Debug</Configurations>
</PropertyGroup>

<PropertyGroup>
Expand Down
18 changes: 13 additions & 5 deletions ElectronicObserver/Window/FormBrowserHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,18 @@ public FormBrowserHost(object parent)

private static int GetPort()
{
#if BROWSER_DEBUG
return 45467;
#else
TcpListener server = new(IPAddress.Loopback, 0);
server.Start();

int port = ((IPEndPoint)server.LocalEndpoint).Port;

server.Stop();

return port;
#endif
}

public void Translate()
Expand Down Expand Up @@ -197,6 +201,10 @@ await MagicOnionHost.CreateDefaultBuilder()

private void LaunchBrowserProcess()
{
#if BROWSER_DEBUG
return;
#endif

try
{
// プロセス起動
Expand Down Expand Up @@ -306,7 +314,7 @@ public BrowserConfiguration ConfigurationCore
UseVulkanWorkaround = c.UseVulkanWorkaround,
Volume = c.Volume,
IsMute = c.IsMute,
IsBrowserContextMenuEnabled = c.IsBrowserContextMenuEnabled,
IsBrowserContextMenuEnabled = c.IsBrowserContextMenuEnabled,
MainFont = Utility.Configuration.Config.UI.MainFont.FontData!.Name,
UseCustomBrowserFont = Utility.Configuration.Config.UI.UseCustomBrowserFont,
BrowserFont = Utility.Configuration.Config.UI.BrowserFontName,
Expand Down Expand Up @@ -464,7 +472,7 @@ private string BuildDownstreamProxy()
{
return config.DownstreamProxy;
}

if (config.UseSystemProxy)
{
return APIObserver.Instance.ProxyPort.ToString();
Expand Down

0 comments on commit 8c35ebe

Please sign in to comment.