OnFrameLoadedStart ?

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

OnFrameLoadedStart ?

Postby vmars316 » Thu Oct 08, 2020 10:31 am

Hello & Thanks ;

What I want to do is
Check the requested Url against a list of safe sites
if there is a hit then 'let it load'
if not safe then load a 'NotSafeMsg.html ' .
Code is all written , but I dont know how to catch load event .
Thanks for your help .
I tried this , no errors , but no MsgBox msg either .
Code: Select all
    Private Sub OnFrameLoadedStart(sender As Object, args As FrameLoadStartEventArgs)
        MsgBox("FrameLoadedStarted")
    End Sub


Code: Select all
Imports cef
Imports CefSharp
Imports CefSharp.WinForms
Imports System.Windows.Forms

Public Class Form1
    Private WithEvents browser As ChromiumWebBrowser
    Public Sub New()
        ' This call is required by the designer.
        InitializeComponent()
        ' Add any initialization after the InitializeComponent() call.
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim setting As New CefSettings
        '        setting.RemoteDebuggingPort = 8088
        CefSharp.Cef.Initialize(setting)
        browser = New ChromiumWebBrowser("https://www.google.com/") With {
                .Dock = DockStyle.Fill
                }
        Panel1.Controls.Add(browser)
        '        browser.Load(TextBox1.Text)
        '        browser.Load("duckduckgo.com")

    End Sub
    Private Sub OnFrameLoadedStart(sender As Object, args As FrameLoadStartEventArgs)
        MsgBox("FrameLoadedStarted")
    End Sub
    Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
        browser.Load(TextBox1.Text)
    End Sub

End Class
vmars316
Techie
 
Posts: 18
Joined: Sat Sep 26, 2020 9:40 pm

Re: OnFrameLoadedStart ?

Postby magreenblatt » Thu Oct 08, 2020 10:39 am

You need to use OnBeforeBrowse or OnBeforeResourceLoad.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: OnFrameLoadedStart ?

Postby vmars316 » Thu Oct 08, 2020 5:01 pm

Thanks ;
Neither OnBeforeBrowse or OnBeforeResourceLoad Ran/Executed , in either .cs or .vb .

Code: Select all
        private void OnBeforeBrowse(object sender, FrameLoadStartEventArgs args)
        {
            label1.Text = "OnBeforeBrowse";
        }


Code: Select all
    Private Sub OnBeforeBrowse(sender As Object, args As FrameLoadStartEventArgs)
        MsgBox("OnBeforeBrowse")
    End Sub


Please aim me at DOCS OnBeforeBrowse or OnBeforeResourceLoad ?
Thanks
vmars316
Techie
 
Posts: 18
Joined: Sat Sep 26, 2020 9:40 pm

Re: OnFrameLoadedStart ?

Postby vmars316 » Fri Oct 09, 2020 6:46 pm

I see nothing here:
http://cefsharp.github.io/api/84.4.x/html/N_CefSharp_Event.htm
about OnBeforeBrowse or OnBeforeResourceLoad .
?
Thanks
vmars316
Techie
 
Posts: 18
Joined: Sat Sep 26, 2020 9:40 pm


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 15 guests