Cefglue opens a new tab in restored window state

37 Views Asked by At

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
1

There are 1 best solutions below

0
On BEST ANSWER

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 :

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