Skip to content

Commit f4ea6df

Browse files
Gire Jean-PhilippeGire Jean-Philippe
authored andcommitted
Added UserAgentFallback to App
1 parent 672e3b8 commit f4ea6df

File tree

4 files changed

+43
-1
lines changed

4 files changed

+43
-1
lines changed

ElectronNET.API/App.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,34 @@ public void DockSetIcon(string image)
15271527
BridgeConnector.Socket.Emit("appDockSetIcon", image);
15281528
}
15291529

1530+
/// <summary>
1531+
/// A String which is the user agent string Electron will use as a global fallback.
1532+
/// </summary>
1533+
public string UserAgentFallback
1534+
{
1535+
get
1536+
{
1537+
return Task.Run<string>(() =>
1538+
{
1539+
var taskCompletionSource = new TaskCompletionSource<string>();
1540+
1541+
BridgeConnector.Socket.On("appGetUserAgentFallbackCompleted", (result) =>
1542+
{
1543+
BridgeConnector.Socket.Off("appGetUserAgentFallbackCompleted");
1544+
taskCompletionSource.SetResult((string)result);
1545+
});
1546+
1547+
BridgeConnector.Socket.Emit("appGetUserAgentFallback");
1548+
1549+
return taskCompletionSource.Task;
1550+
}).Result;
1551+
}
1552+
set
1553+
{
1554+
BridgeConnector.Socket.Emit("appSetUserAgentFallback", value);
1555+
}
1556+
}
1557+
15301558
internal void PreventQuit()
15311559
{
15321560
_preventQuit = true;

ElectronNET.Host/api/app.js

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

0 commit comments

Comments
 (0)