HISE Logo Forum
    • Categories
    • Register
    • Login

    Setting WebView default page

    Scheduled Pinned Locked Moved Scripting
    5 Posts 2 Posters 313 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      ssh1be
      last edited by

      Hey all, im new to HISE and VST development in general so please bear with me. I'm currently playing around with the WebView component and i'm still trying to figure out how I could set it's content to a webpage of my choice. My current setup isn't working:

      d42a8080-69bf-469d-ade1-3dd48e2792a9-image.png

      By right click and inspect, I can change the webpage to "localhost:5000" using this.document.location, however i'd like this to be done automatically. Also, when using the WebView component in a DAW via exporting as a VST, if I minimize the VST, the webpage is lost and I have to change it again using the developer console. Are there any workarounds to this?

      Any help would be much appreciated,
      Thank you!

      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @ssh1be
        last edited by

        You're approaching this from the wrong angle - you need to copy your website into your project repository and then specify the root file (usually index.html), then the webview will load that file automatically (acting as your local server and serving all required files either from disk (while developing) or from the embedded cache (when it's exported as plugin).

        Have you checked out the examples here?

        Link Preview Image
        hise_tutorial/WebViewTests at master · christophhart/hise_tutorial

        The Tutorial project for HISE. Contribute to christophhart/hise_tutorial development by creating an account on GitHub.

        favicon

        GitHub (github.com)

        S 1 Reply Last reply Reply Quote 0
        • S
          ssh1be @Christoph Hart
          last edited by

          @Christoph-Hart

          I see. However what if for my use case I want to access a website that is hosted elsewhere. Let's use "https://hise.dev/" for example or "https://google.com". Is there anyway I could automatically set the WebView to an externally hosted site on load?

          Thank you

          Christoph HartC 1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart @ssh1be
            last edited by

            @ssh1be Maybe with an iframe, but that's very 90ies...

            Link Preview Image
            W3Schools.com

            Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.

            favicon

            (www.w3schools.com)

            S 1 Reply Last reply Reply Quote 0
            • S
              ssh1be @Christoph Hart
              last edited by

              @Christoph-Hart
              Sweet thank you I got it working! Iframes were somewhat functional, but setting this as my index file allows me to use the WebView exactly as I intended:

              a2d3c055-6370-4dc7-82f4-0db8d565ae25-image.png

              Thanks again

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              47

              Online

              1.7k

              Users

              11.7k

              Topics

              101.8k

              Posts