I opened a ticket with DotNetBrowser, but they will be at the office on Monday, hoping I can get some expert opnion on this from you guys.
I want to start DotNetBrowser with the chromium switches, but it is not working for me.
UPDATE #1:
My application is Console (not windows forms), Here is my full code
'Some kind of static class to hold some objects globally
Module GlobalObjects
Public browserwindobj As BrowserWindow
Public ChromeUserProfilePath as String
End Module
'Main Module
<STAThread>
Public Sub Main(args() As String)
GlobalObjects.browserwindobj= New BrowserWindow()
GlobalObjects.browserwindobj.BeginSession()
End Sub
'Browser Window Class
Public Class BrowserWindow
Dim WithEvents wb As Browser
Dim m_browsercontext As BrowserContext
Dim WithEvents NetworkDelegateObj As DelegateNetworking
Sub BeginSession()
Start.AddUILog("Starting session...")
Start.DelayCloser()
CreateBrowser()
NavigateToURL()
m_sessionstatus = TimerState.Running
End Sub
Private Sub CreateBrowser()
Try
Start.AddUILog("Creating internal browser...")
BrowserPreferences.SetUserAgent("UserAgent_HERE")
Dim chrmswitches As New List(Of String)
chrmswitches.Add("--disable-web-security")
chrmswitches.Add("--reduce-security-for-testing")
chrmswitches.Add("--allow-running-insecure-content")
chrmswitches.Add("--ignore-certificate-errors")
chrmswitches.Add("--unsafe-pac-url")
chrmswitches.Add("--no-sandbox")
GlobalObjects.ChromeUserProfilePath = modGeneral.softwarePath & "\_temp\" & modGeneral.GenerateID("Profile ", True)
Dim contextparam As New BrowserContextParams(ChromeUserProfilePath)
If GlobalObjects.SettingsObj.EnableProxies = True Then
contextparam.ProxyConfig = New URLProxyConfig("http://PAC_FILE_URL")
Else
Start.AddUILog("Proxies usage is disabled by the user")
End If
Dim context As New BrowserContext(contextparam)
context.NetworkService.ResourceHandler = New DelegateAjax
context.NetworkService.CertificateVerifier = New DelegateCertificateVerifier
NetworkDelegateObj = New DelegateNetworking()
context.NetworkService.NetworkDelegate = NetworkDelegateObj
m_browsercontext = context
If GlobalObjects.SettingsObj.CPUBased = True Then
chrmswitches.Add("--disable-gpu")
chrmswitches.Add("--disable-gpu-compositing")
chrmswitches.Add("--enable-begin-frame-scheduling")
chrmswitches.Add("--software-rendering-fps=60")
BrowserPreferences.SetChromiumSwitches(chrmswitches.ToArray)
wb = BrowserFactory.Create(context, BrowserType.LIGHTWEIGHT)
Else
BrowserPreferences.SetChromiumSwitches(chrmswitches.ToArray)
wb = BrowserFactory.Create(context, BrowserType.HEAVYWEIGHT)
End If
wb.Preferences.AllowDisplayingInsecureContent = True
wb.Preferences.AllowRunningInsecureContent = True
wb.Preferences.PluginsEnabled = True
wb.Preferences.WebAudioEnabled = True
wb.Preferences.WebRTCIPHandlingPolicy = BrowserPreferences.WebRTCIPHandlingPolicyEnum.DisableNonProxiedUdp
wb.Preferences.DatabasesEnabled = True
mous = New MouseControler(wb)
Catch ex As Exception
Start.AddUILog("Create Browser: " & ex.Message)
Process.GetCurrentProcess.Kill()
End Try
End Sub
End Class
Update #2
Here is the DotNetBrowser Logs:
4/21/2018 5:57:08 PM Information Browser - OS name: Microsoft Windows Server 2016 Standard Evaluation []
4/21/2018 5:57:08 PM Information Browser - OS version: 10.0.14393 []
4/21/2018 5:57:08 PM Information Browser - DotNetBrowser build: 1.14.2.0 []
4/21/2018 5:57:08 PM Information Browser - Verifying Chromium binaries... []
4/21/2018 5:57:08 PM Information Browser - Chromium binaries are OK. []
4/21/2018 5:57:08 PM Information IPC - Starting IPC... []
4/21/2018 5:57:08 PM Information IPC - Starting IPC Server... []
4/21/2018 5:57:08 PM Information IPC - Starting IPC Process... []
4/21/2018 5:57:08 PM Information Process - Start Chromium process... [IPC Process Thread]
4/21/2018 5:57:08 PM Information Process - Command line: C:\Users\Administrator\AppData\Local\Temp\2\dotnetbrowser-chromium\60.0.3112.113.1.14.2.0.523c\browsercore32.exe"--port=61259" "--no-sandbox" "--pid=8172" "--crash-dump-dir=C:\Users\Administrator\AppData\Roaming\DotNetBrowser\dotnetbrowser.dmp.dir" "--user-agent=Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MALCJS; rv:11.0) like Gecko" "--disable-surfaces" "--noerrdialogs" "--enable-logging" "--disable-web-security" "--reduce-security-for-testing" "--unsafe-pac-url" "--disable-gpu" "--disable-gpu-compositing" "--enable-begin-frame-scheduling" "--software-rendering-fps=60" [IPC Process Thread]
4/21/2018 2:57:08 PM Information IPC - Shared Memory Name: 7e8897cf-0d60-45fa-9411-da1ab3467321 [IPC Server Thread]
4/21/2018 2:57:08 PM Information IPC - Creating IPC connection. Connection ID: 0 [IPC Server Thread]
4/21/2018 2:57:08 PM Information IPC - IPC connection has been established. Connection ID: 17099024 [IPC Server Thread]
4/21/2018 2:57:08 PM Information IPC - READ: OnHelloMessage{type=OnHelloMessage, uid=1, message='cid:0,type:Main'}, []
4/21/2018 2:57:08 PM Information IPC - WRITE: SetNetworkDelegateConfigMessage{type=SetNetworkDelegateConfig, uid=0, browserContextId=0, DisableMessages=False, DisableResourceMessages=False}, SocketInfo{channelId=0, browserId=-1, channelType=Main} [Memory Writer SocketInfo{channelId=0, browserId=-1, channelType=Main}]
4/21/2018 2:57:08 PM Information IPC - IPC is started. []
4/21/2018 2:57:08 PM Information IPC - WRITE: SetAuthServerWhiteListMessage{type=SetAuthServerWhiteList, uid=1, BrowserContextId=0, ServerWhiteList=, DelegateWhiteList=}, SocketInfo{channelId=0, browserId=-1, channelType=Main} [Memory Writer SocketInfo{channelId=0, browserId=-1, channelType=Main}]
4/21/2018 2:57:08 PM Information IPC - Socket connection checker started for [Socket Connection Checker SocketInfo{channelId=0, browserId=-1, channelType=Main}]
4/21/2018 2:57:08 PM Information IPC - WRITE: CreateBrowserMessage{type=CreateBrowser, uid=2, channelId=0, contextId=0, cacheDir='C:\Users\Administrator\AppData\Roaming\LKBrowser\_temp\Profile 21417577722\Cache', memoryDir='', dataDir='C:\Users\Administrator\AppData\Roaming\LKBrowser\_temp\Profile 21417577722', currentLocale='en-us', proxyType=2, proxyRules='', proxyBypassRules='', proxyAutoConfigURL='http://PACFILEURL_OMITTED', defaultZoomLevel='0', isOffScreenMode='True', storageType='DISK}, SocketInfo{channelId=0, browserId=-1, channelType=Main} [Memory Writer SocketInfo{channelId=0, browserId=-1, channelType=Main}]
4/21/2018 2:57:08 PM Information IPC - READ: OnNetworkDelegateReadyMessage{type=OnNetworkDelegateReady, uid=2, browserContextId=0}, SocketInfo{channelId=0, browserId=-1, channelType=Main} []
4/21/2018 2:57:08 PM Information IPC - WRITE: SetNetworkDelegateConfigMessage{type=SetNetworkDelegateConfig, uid=3, browserContextId=0, DisableMessages=False, DisableResourceMessages=False}, SocketInfo{channelId=0, browserId=-1, channelType=Main} [Memory Writer SocketInfo{channelId=0, browserId=-1, channelType=Main}]
4/21/2018 2:57:08 PM Information IPC - Shared Memory Name: 2747a61b-8340-42d3-950a-f88e01c4c4e8 [IPC Server Thread]
4/21/2018 2:57:08 PM Information IPC - Creating IPC connection. Connection ID: 0 [IPC Server Thread]
4/21/2018 2:57:08 PM Information IPC - WRITE: SetAuthServerWhiteListMessage{type=SetAuthServerWhiteList, uid=4, BrowserContextId=0, ServerWhiteList=, DelegateWhiteList=}, SocketInfo{channelId=0, browserId=-1, channelType=Main} [Memory Writer SocketInfo{channelId=0, browserId=-1, channelType=Main}]
4/21/2018 2:57:08 PM Information IPC - READ: OnNetworkDelegateReadyMessage{type=OnNetworkDelegateReady, uid=3, browserContextId=0}, SocketInfo{channelId=0, browserId=-1, channelType=Main} []
4/21/2018 2:57:08 PM Information IPC - WRITE: SetNetworkDelegateConfigMessage{type=SetNetworkDelegateConfig, uid=5, browserContextId=0, DisableMessages=False, DisableResourceMessages=False}, SocketInfo{channelId=0, browserId=-1, channelType=Main} [Memory Writer SocketInfo{channelId=0, browserId=-1, channelType=Main}]
4/21/2018 2:57:08 PM Information IPC - WRITE: SetAuthServerWhiteListMessage{type=SetAuthServerWhiteList, uid=6, BrowserContextId=0, ServerWhiteList=, DelegateWhiteList=}, SocketInfo{channelId=0, browserId=-1, channelType=Main} [Memory Writer SocketInfo{channelId=0, browserId=-1, channelType=Main}]
4/21/2018 2:57:08 PM Information IPC - IPC connection has been established. Connection ID: 17100944 [IPC Server Thread]
4/21/2018 2:57:08 PM Information IPC - READ: OnHelloMessage{type=OnHelloMessage, uid=4, message='cid:0,bid:0,type:Browser'}, []
4/21/2018 2:57:08 PM Information IPC - Channel is connected: SocketInfo{channelId=0, browserId=0, channelType=Browser} []
4/21/2018 2:57:08 PM Information IPC - Socket connection checker started for [Socket Connection Checker SocketInfo{channelId=0, browserId=0, channelType=Browser}]
4/21/2018 2:57:08 PM Information IPC - READ:
OnBeforeSendHeadersMessage{type=OnBeforeSendHeaders, uid=5, browserContextId=0, RequestId=1, url=PACURL_OMITTED, method=GET, originalHeaders='User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MALCJS; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
Accept-Language: en-us
', overrideHeaders='', renderProcessId=-1, renderFrameId=-1}, SocketInfo{channelId=0, browserId=-1, channelType=Main} []
4/21/2018 2:57:08 PM Information IPC - WRITE: OnBeforeSendHeadersMessage{type=OnBeforeSendHeaders, uid=5, browserContextId=0, RequestId=1, url=PACURL_OMITTED, method=GET, originalHeaders='User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MALCJS; rv:11.0) like Gecko
Accept-Encoding: gzip, deflate
Accept-Language: en-us
I took all the switches in the log and ran them aganist chrome.exe manually using cmd, and the switches did work (had to add space before the --port
switch)
I then also using cmd, tested the switches aganist the browsercore32.exe but I got a cmd error saying that I need to add space before --port
, once I added that space, the browsercore process starts.
I was wondering, is the problem is with this line:
4/21/2018 5:57:08 PM Information Process - Command line: C:\Users\Administrator\AppData\Local\Temp\2\dotnetbrowser-chromium\60.0.3112.113.1.14.2.0.523c\browsercore32.exe"--port=61259" "--no-sandbox" "--pid=8172" "--crash-dump-dir=C:\Users\Administrator\AppData\Roaming\DotNetBrowser\dotnetbrowser.dmp.dir" "--user-agent=Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; MALCJS; rv:11.0) like Gecko" "--disable-surfaces" "--noerrdialogs" "--enable-logging" "--disable-web-security" "--reduce-security-for-testing" "--unsafe-pac-url" "--disable-gpu" "--disable-gpu-compositing" "--enable-begin-frame-scheduling" "--software-rendering-fps=60" [IPC Process Thread]
The "--port
is right after the .exe
without a space separating them.
So shouldn't it be browsercore32.exe" --port=61259"
Well, that's the only thing I see why switches are not being read.
Anyway, maybe it's something else I am missing totally.
Update #3:
Chromium logs contain only this:
[0421/191430.232:ERROR:command_processor.cpp(337)] IPC: unhandled callback with ID=568
[0421/191430.299:WARNING:pref_notifier_impl.cc(23)] Pref observer found at shutdown.
[0421/191430.299:WARNING:pref_notifier_impl.cc(23)] Pref observer found at shutdown.
[0421/191430.314:WARNING:pref_notifier_impl.cc(23)] Pref observer found at shutdown.
[0421/191430.314:WARNING:pref_notifier_impl.cc(23)] Pref observer found at shutdown.
Also if I ran --unsafe-pac-url
using cmd aganist chrome.exe, it works perfectly fine.