0
\$\begingroup\$

How to open URL in new tab for WebGL?

Tried Application.OpenURL("url"). But it's opens a tab in same window

Thanks

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

You can't. You don't have any way to set the target attribute from within the player. The docs for the OpenURL state

When executed in the web player, the page the plugin is contained in will be redirected to the url.

I would just assume that it's also true for the webGL player.

But if you took the time to read the maunual, you could write a simple javascript to open new tabs, and call that from the webGL player.

Your probably getting down voted because this info is readily available.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ thanks dval. I just found this link and solved the problem va.lent.in/opening-links-in-a-unity-webgl-project \$\endgroup\$ Commented Jan 27, 2016 at 6:49
  • \$\begingroup\$ Looks like they changed. according to the latest Unity docs "From version 2019.4.25f1, 2020.3.5f1, 2021.1.2f1, and 2021.2.0a11, Application.OpenURL opens url in a new browser tab." \$\endgroup\$ Commented Mar 4, 2022 at 22:43

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.