Search Issue Tracker
Fixed in 2021.2.X
Fixed in 2019.4.X, 2020.3.X, 2021.1.X
Votes
1
Found in
Issue ID
1320393
Regression
No
Application.OpenURL() not working for WebGL builds
Steps to reproduce:
1. Use "Application.OpenURL()" API in Script to open a Website.
2. Build project as "WebGL" build target.
3. Trigger script in "WebGL" build.
Expected behaviour:
Website is opened in new window or tab.
Actual behaviour:
Website is loaded in same tab as the game causing the game to be exited.
Notes:
Issue only reproducible in WebGL builds.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
_geo__
Apr 23, 2024 08:28
That this was qualified as a "bugfix" and acually implemented is beyond any reason. This is a BEHAVIOUR change.
The manual reads: From version 2019.4.25f1, 2020.3.5f1, 2021.1.2f1, and 2021.2.0a11, Application.OpenURL opens url in a new browser tab. In previous versions, Application.OpenURL opens url in the same browser tab, which terminates the running Unity application.
So you did change the behaviour from one random PATCH release to another. Well done ... So much for Unitys SEMVER compliance, ridiculous.
KillerSnails
Mar 04, 2022 23:32
@vinodlobo Same thing happen to me. You can try changing
[code=CSharp]Application.OpenURL(newURL);
[/code]
to:
[code=CSharp]Application.ExternalEval("window.open('" + newUrl + "','_self')");
[/code]
KillerSnails
Mar 04, 2022 23:20
Since Unity 5.2's documentation, it states "When executed in the web player, the page the plugin is contained in will be redirected to the url." The WebGL builds used to do the same thing too. Why change this years later?
PieterAlbers
Sep 14, 2021 14:14
We really need the functionality for an additional parameter to define where the url will be opened.
Can this be added please?
nenadrad
Jun 15, 2021 12:06
We have the same problem as the previous commenter. Can an additional parameter be added to this function in order to be able to choose if the URL is going to be opened in the same window or in a new window?
vinodlobo
Jun 09, 2021 16:17
Our application required staying within the same tab when calling an exit URL. Thus this "bug fix" broke our application. How can we call a link that stays within the same tab?