Back to Unity

DryreL Software Unity

Universal URL

Open links on every Unity platform

One call opens a link on WebGL, desktop and mobile, without popup-blocker trouble. Available now on GitHub.

Available on GitHub

  • 6Platforms
  • 2Methods to learn
  • 0Scene objects needed

Overview

What it does

A lightweight cross-platform URL opener for Unity, with a native bridge for WebGL and smart fallbacks on desktop and mobile.

  • Unity
  • C#
  • WebGL

Platforms

  • WebGL
  • Windows
  • macOS
  • Linux
  • Android
  • iOS

Features

Built to just work

  • Every platformWebGL, Windows, macOS, Linux (including WSL), Android and iOS.
  • Reliable on WebGLA native .jslib bridge opens links in a new tab without popup-blocker problems.
  • Smart fallbacksOn Linux and WSL it tries wslview, xdg-open, PowerShell and cmd.exe before falling back to Application.OpenURL.
  • Static APICall it from anywhere, with no MonoBehaviour or scene object.
  • Package ManagerInstall straight from the Git URL.

Reference

API

MethodWhat it does
UniversalURL.Open(url)Opens the URL in the default browser. The protocol (https://) is required.
UniversalURL.OpenURL(url)Opens the URL and adds https:// when the protocol is missing.

Get started

Install and use

Install

Window > Package Manager > + > Add package from git URL...
https://github.com/DryreL/Unity-UniversalURL.git

Usage

UniversalURL.Open("https://example.com");      // needs the protocol
UniversalURL.OpenURL("patreon.com/c/Viznity"); // adds https:// if missing

Requirements

Before you start

  • Unity 2021.2 or newer