-
-
Notifications
You must be signed in to change notification settings - Fork 429
Open
Description
How do I get a notification from each tab that a page is loaded?
I created a form to control the browser.
Logic:
-
- open the browser;
- open multiple links in a separate tab;
Question.
- How do I get a notification from each tab that the download is finished and the page is fully loaded?
Form1.cs
`namespace CefSharpWinFormsAndSharpBrowser
{
public partial class Form1 : Form
{
BrowserService browserService = new BrowserService();
public Form1()
{
InitializeComponent();
// Form1Tests form1Tests = new Form1Tests(this);
// form1Tests.Owner = this;
}
/// <summary>
/// Open browser
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
browserService.OpenBrowser();
}
/// <summary>
/// Goto URL
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button10_Click(object sender, EventArgs e)
{
List<string> urls = new List<string>()
{
"github.com",
"stackoverflow.com",
"habr.com"
};
foreach (string url in urls)
{
browserService.AddNewBrowser(url);
// browserService.LoadURL(url);
}
}
}
}
`
BrowserService.cs
`using SharpBrowser;
using SharpBrowser.BrowserTabStrip;
using System.IO;
namespace CefSharpWinFormsAndSharpBrowser.Services
{
public class BrowserService
{
// Form _formBrowser;
MainForm mainForm = new MainForm();
SharpTab SharpTab = new SharpTab();
FileService fileService = new FileService();
private SharpBrowser.BrowserTabStrip.BrowserTabStrip TabPages = new SharpBrowser.BrowserTabStrip.BrowserTabStrip();
public BrowserService()
{
}
public void OpenBrowser()
{
mainForm.Show();
}
public void AddNewBrowser(string url)
{
mainForm.AddNewBrowserTab(url);
}
public void LoadURL(string url)
{
mainForm.LoadURLPublic(url);
}
}
}`
Metadata
Metadata
Assignees
Labels
No labels