Custom browser - parameters

0 favourites
  • 5 posts
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • 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

  • 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

  • Why do you need to do that? Can't you set the proxy settings from Chrome's settings?

  • 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:

     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
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)