Cefglue opens a new tab in restored window state

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Cefglue opens a new tab in restored window state

Postby ITResearcher » Fri Nov 11, 2022 6:54 am

I am using cefglue of below specification in my app. Whenever I click on a link, and if link opens in new tab it's window state is always in restored state.
How to open the tab always in maximized state?

My Current Setup :-
CEF_VERSION = "106.0.26+ge105400+chromium-106.0.5249.91";
CEF_Glue_VERSION : 106.0.26.0
IDE: Visual Studio/express 2019
Application Type : Windows Forms
ITResearcher
Newbie
 
Posts: 6
Joined: Fri Jul 23, 2021 4:12 am

Re: Cefglue opens a new tab in restored window state

Postby ITResearcher » Sat Nov 26, 2022 6:39 am

To maximize the new tab that opened I have used OnBeforePopup handle which is a part of CefLifeSpanHandler and set the windowInfo.Style property to Maximize like so :

Code: Select all
Protected Overrides Function OnBeforePopup(browser As Xilium.CefGlue.CefBrowser, frame As Xilium.CefGlue.CefFrame, targetUrl As String, targetFrameName As String, targetDisposition As Xilium.CefGlue.CefWindowOpenDisposition, userGesture As Boolean, popupFeatures As Xilium.CefGlue.CefPopupFeatures, windowInfo As Xilium.CefGlue.CefWindowInfo, ByRef client As Xilium.CefGlue.CefClient, settings As Xilium.CefGlue.CefBrowserSettings, ByRef noJavascriptAccess As Boolean) As Boolean
        ' If browser.IsPopup Then
        Try

            windowInfo.Style = windowInfo.Style Or WS_MAXIMIZE
            Return MyBase.OnBeforePopup(browser, frame, targetUrl, targetFrameName, targetDisposition, userGesture, popupFeatures, windowInfo, client, settings, noJavascriptAccess)

        Catch ex As Exception
            MsgBox("Issue")
        End Try

End Function
ITResearcher
Newbie
 
Posts: 6
Joined: Fri Jul 23, 2021 4:12 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 43 guests