mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-07 12:16:04 +00:00
Fix bug when use the devtools protocol with the remote allow origins (Fix WebSocket error)
This commit is contained in:
parent
4c0895850b
commit
98e73b2372
|
@ -150,9 +150,11 @@ namespace WelsonJS.Launcher
|
||||||
}
|
}
|
||||||
public static void OpenWebBrowser(string url)
|
public static void OpenWebBrowser(string url)
|
||||||
{
|
{
|
||||||
|
Uri resourceServerUri = new Uri(GetAppConfig("ResourceServerPrefix"));
|
||||||
|
Uri devToolsUri = new Uri(GetAppConfig("DevToolsPrefix"));
|
||||||
|
|
||||||
string userDataDir = Path.Combine(GetAppDataPath(), "EdgeUserProfile");
|
string userDataDir = Path.Combine(GetAppDataPath(), "EdgeUserProfile");
|
||||||
string remoteAllowOrigins = GetAppConfig("ResourceServerPrefix");
|
string remoteAllowOrigins = $"{resourceServerUri.Scheme}://{resourceServerUri.Host}:{resourceServerUri.Port}";
|
||||||
int remoteDebuggingPort = new Uri(GetAppConfig("DevToolsPrefix")).Port;
|
|
||||||
string[] arguments = {
|
string[] arguments = {
|
||||||
$"\"{url}\"",
|
$"\"{url}\"",
|
||||||
$"--remote-debugging-port={remoteDebuggingPort}",
|
$"--remote-debugging-port={remoteDebuggingPort}",
|
||||||
|
|
|
@ -395,7 +395,7 @@
|
||||||
if (response.id == 3) {
|
if (response.id == 3) {
|
||||||
const responseContent = response.result.result.value;
|
const responseContent = response.result.result.value;
|
||||||
|
|
||||||
appendTextToEditor(responseContent);
|
appendTextToEditor("/*\n" + responseContent + "\n*/");
|
||||||
pushPromptMessage("assistant", responseContent);
|
pushPromptMessage("assistant", responseContent);
|
||||||
|
|
||||||
socket.close();
|
socket.close();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user