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
- Sprite Editor Window not visualizing changes when selecting different Filter Modes
- Crash on UnityEngine.Rendering.RenderPipelineAsset:InternalCreatePipeline () when opening a project
- The Texture Shape of an Image changes from 2D to a Cube when the project is upgraded to 2019 and above
- Building 3D Sample Scenes (URP) Project fails
- Alpha channel is disabled when Alpha Clip Threshold is set to 0
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?