MIRAweb without start page

Scott Porter's icon

Is there a way to configure the miraweb URL to jump directly to the patch? When I start MiraWeb, it goes to a page that says "Enter the details of the Max host to connect to." but all the details are already correctly configured and "Connect" just needs to be clicked.

Is there a way to skip this step or automatically click connect?

joseph digerness's icon

did you see this? works for me.

Scott Porter's icon

I’ll give that a try, thank you!

Florian Demmer's icon

Hi there,

the suggestion in the linked post should work.

If you'd like more control over this - just taking a quick look at the code it seems that it could be enabled and become user controllable with something like a query param with a minor change if you feel comfortable building the MiraWeb WebApp.

If you look at the startup sequence here the hostname and port are parsed from the querystring and passed to the App Component as props, which is responsible for setting up the connection dialogue.

If you look in the connection dialogue itself there is already some code in place that forces a connection without user interaction when running the code in development on line 51

Let's imagine we'll be using an additional query param forceConnect. What you could do is something along the following lines

  1. Parse the query string as part of the startup sequence

  2. Pass it as prop to <App /> and within there as a prop to <ConnectDialog/>

  3. Adjust the componentDidMount method to take the new prop into account

    componentDidMount() {
      // force connect in debug build or when forceConnect was set as query param
      if (
        (__MW_DEV_SERVER__ || this.props.forceConnect) &&
        this._connectionShowsDialog(this.state.connectionState)
      ) {
        this._onConnect();
      }
    }