Custom browser - parameters

Discussion and feedback on Construct 2

Post » Fri Dec 06, 2013 10:50 pm

Hi,

In the custom browser option I can't seem to define any command line parameters?!

I could probably reference a script or such to achieve launching "chrome.exe -proxy-server=" but surely this should be able to be defined by the custom browser string?!

I don't actually get why the string needs to be qualified either (not as in path but valid)

Thanks
Daniel
B
9
S
3
G
1
Posts: 112
Reputation: 1,827

Post » Thu Dec 12, 2013 11:27 am

Got annoyed and created a work around, not sure anyone else will make use of this but here's the VBS I call as the custom browser.


Option Explicit
On Error Resume Next

Dim oShell
Set oShell = WScript.CreateObject("Wscript.Shell")

Dim strBrowser, strBrowserArg, strARG
strARG = WScript.Arguments.Item(0) ' This captures the preview URL passed by Contruct2
strBrowser = Chr(34) & "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" & Chr(34) 'This is the Browser
strBrowserArg = " -proxy-server= " 'This is the Browser Arguments

If strARG = empty Then
     MsgBox "Unable to identify URL passed from Contruct2!"
Else
     oShell.Run strBrowser & strBrowserArg & strARG,1,True
End If
B
9
S
3
G
1
Posts: 112
Reputation: 1,827

Post » Thu Dec 12, 2013 1:25 pm

Why do you need to do that? Can't you set the proxy settings from Chrome's settings?
Scirra Founder
B
397
S
236
G
88
Posts: 24,423
Reputation: 194,560

Post » Thu Dec 12, 2013 2:31 pm

I work in a corporate environment that uses a proxy configuration script (.pac), unfortunately this causes issues in chrome with loopback;

"Server Error

The following error occurred:
[code=CANT_CONNECT_LOOPBACK] Cannot connect due to potential loopback problems"

I wanted to specify the -proxy-server= (no proxy) argument to chrome to overcome this but found that the custom browser string wouldn't accept any arguments?! therefore I created and used the above script as my custom browser option :)

Like I said it's not likely this will effect many (if any but me) but it's a workaround should anyone need it :)

Cheers,
Daniel
B
9
S
3
G
1
Posts: 112
Reputation: 1,827

Post » Wed Aug 10, 2016 3:41 pm

I know this is an old topic but I ran into the same problem today – and found a way around! So I may as well post it here, for what it's worth. :)

Because I make my game on my work computer most of the time (during lunch-time hey ;) ), I felt I should keep it private as much as possible. So I decided to configure Construct 2 so that it would run the preview builds using Firefox (default on my system) in private mode (not default)... But soon noticed that adding a command-line parameter in Construct 2's "Custom browser" setting wouldn't work!? I tried tricking it to work using double quotes, to no end... Then I found a way. ^^

If you create a shortcut to the browser with Windows, and add the command-line parameter(s) in it, Construct 2 will accept it in the "Custom browser" setting. You will have to type the whole path and shortcut name in that text field though, as picking the shortcut with the "Open file" dialog won't work! So just type or copy-paste the path and name of the shortcut, preferably with no spaces in the name of the shortcut, and don't forget to add the ".lnk" extension.

It should then work and you'll be able to use whatever special commands you mean to use while previewing a Construct 2 project. That's it!
B
8
S
1
Posts: 15
Reputation: 470


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests