mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-27 09:22:30 +00:00
Completed APIs from #956
This commit is contained in:
@@ -131,6 +131,34 @@ public class WebContents : ApiBase
|
||||
remove => RemoveEvent(value, Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Emitted when media becomes audible or inaudible. The parameter is true if one or more
|
||||
/// frames or child web contents are emitting audio.
|
||||
/// </summary>
|
||||
public event Action<bool> OnAudioStateChanged
|
||||
{
|
||||
add => AddEvent(value, Id);
|
||||
remove => RemoveEvent(value, Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Emitted when media starts playing.
|
||||
/// </summary>
|
||||
public event Action OnMediaStartedPlaying
|
||||
{
|
||||
add => AddEvent(value, Id);
|
||||
remove => RemoveEvent(value, Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Emitted when media is paused or done playing.
|
||||
/// </summary>
|
||||
public event Action OnMediaPaused
|
||||
{
|
||||
add => AddEvent(value, Id);
|
||||
remove => RemoveEvent(value, Id);
|
||||
}
|
||||
|
||||
internal WebContents(int id)
|
||||
{
|
||||
Id = id;
|
||||
@@ -611,6 +639,22 @@ public class WebContents : ApiBase
|
||||
BridgeConnector.Socket.Emit("webContents-centerSelection", Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scrolls to the top of the current web page.
|
||||
/// </summary>
|
||||
public void ScrollToTop()
|
||||
{
|
||||
BridgeConnector.Socket.Emit("webContents-scrollToTop", Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scrolls to the bottom of the current web page.
|
||||
/// </summary>
|
||||
public void ScrollToBottom()
|
||||
{
|
||||
BridgeConnector.Socket.Emit("webContents-scrollToBottom", Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Inserts text to the focused element.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user