Overview

Always open in specific browser

Add this class to your project to always open with Chrome instead of your default browser (Firefox in my case) when you click "Play" or "Start Server". Note: This is an editor class and should either be put into an editor-only assembly or wrapped in #if UNITY_EDITOR and #endif.

using System.Diagnostics;
using UnityEditor;
using UnityEngine;
using Needle.Engine;

[InitializeOnLoad]
public static class CustomBrowserOpen
{
    static CustomBrowserOpen()
    {
        Init();
    }

    [RuntimeInitializeOnLoadMethod]
    static void Init()
    {
        ActionsBrowser.BeforeOpen += ActionsBrowser_BeforeOpen;
    }

    private static void ActionsBrowser_BeforeOpen(ActionsBrowser.OpenBrowserArguments args)
    {
        args.PreventDefault = true;
        string processArgs = args.Url;
        var psi = new ProcessStartInfo
        {
            FileName = "chrome.exe",
            Arguments = processArgs
        };
        Process.Start(psi);
    }
}