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
- Profiler disconnects from WebGL Player when it gets clicked on in URP
- Crash on -[NSApplication _crashOnException:] when opening a specific custom Editor window
- Sprite editor does not allow creating new sprite tiles in a sprite sheet with a specific name
- Crash on block_locate_free when rendering a specific scene
- A submenu disappears on MacOS when the MenuItem method argument "isVariableFunction" is set to "false" and priority argument is set to "-1"
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?