Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
459 views
in Technique[技术] by (71.8m points)

vb.net - Cannot get CefSharp Chromium web brower to work on target PC

I have a Windows VB application developed in Visual Studio 2013 that incorporates a CefSharp Chromium web browser (version 86.0.241 using the NuGet packages). Target CPU is set to x86, the build output path is set to binx86debug, Configuration is set to Active (debug) and the Platform is set to Active (x86). The web browser works great on the development machine, but when I deploy the app to the target machine (which is a server), the browser displays a blank screen and freezes.

The CefSharp support files are included in the deployment package (InnoSetup), but I'm confused on which version of VC++ redistributables I need to deploy.The CefSharp FAQ's state that with versions 65.0.0 and above, the minimum of VC++2015 needs to be deployed. I had the client install this version on the target machine (when I originally deployed this app, I did not include the VC++ redistributables), but the browser still does not work. Do I need to deploy a different version?

Any other ideas on what I'm doing wrong? Please help!

Larry

Here is a link to the .zip file containing the CEF debug.log files from the client's three servers (the three servers rotate based on demand):

https://www.dropbox.com/s/b3zjxxk79v9xl9b/DataMinerDebugLogs.zip?dl=0

Please let me know if any of these provides the reason why the Chromium browser is displaying only a blank page.

Thanks.

Details of the log entry mentioned in my last comment: [1228/093028.760:INFO:CONSOLE(32)] "Refused to connect to 'https://collection.decibelinsight.net/i/13878/265573/c.json' because it violates the following Content Security Policy directive: "connect-src https://qbonline.api.intuit.net https://cdn.decibelinsight.net https://api.segment.io 'self' https://.intuit.com https://.intuit.com:* https://.intuitcdn.net: https://hosted-shell-assets-us-west-2.s3.us-west-2.amazonaws.com wss://plugin-localhost.intuitcdn.net:* wss://plugin.intuitcdn.net:* https://.intuit.net wss://.msg.liveperson.net/ws_api/account/ https://*.objectstorage.liveperson.net/ https://scripts.neuro-id.com https://api.neuro-id.com https://logs.neuro-id.com". ", source: https://cdn.decibelinsight.net/i/13878/265573/di.js (32)

Code from Auth Class (the form that opens and displays the Chromium browser):

Imports Intuit.Ipp.OAuth2PlatformClient
Imports System.Net
Imports System.IO
Imports System.Web
Imports CefSharp
Imports CefSharp.WinForms


Public Class Auth
    Public WithEvents Browser As ChromiumWebBrowser
    Dim Settings As New CefSettings
    Private Sub Auth_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        oauthClient = New OAuth2Client(ClientID, ClientSecret, RedirectURL, "production")
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
        Dim scopes As List(Of OidcScopes) = New List(Of OidcScopes)()
        scopes.Add(OidcScopes.Accounting)
        authorizeURL = oauthClient.GetAuthorizationURL(scopes)
        Settings.CefCommandLineArgs.Add("disable-gpu")
        Browser = New ChromiumWebBrowser(authorizeURL)
        Me.Controls.Add(Browser)
        Browser.Dock = DockStyle.Fill
    End Sub

    Private Sub Browser_AddressChanged(sender As Object, e As AddressChangedEventArgs) Handles Browser.AddressChanged
        Dim Str As String = Browser.Address
        If InStr(Str, "&realmID", CompareMethod.Text) Then
            Dim q = HttpUtility.ParseQueryString(Browser.Address)
            Dim Code As String = ""
            Dim RealmID As String = ""
            For Each key In q.Keys
                If InStr(key, "code") Then
                    Code = q.Item(key)
                ElseIf InStr(key, "realmId", CompareMethod.Text) Then
                    RealmID = q.Item(key)
                End If
            Next
            Call GetAuthTokens(Code, RealmID)
        End If
    End Sub
End Class

The "Address_Changed" event can be ignored and the first 5 lines of the "Load" event all relate to another SDK used in the app, none of which is related to the Chromium browser.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...