Search Issue Tracker
Fixed in 2020.1.X
Fixed in 2018.4.X, 2019.2.X, 2019.3.X
Votes
0
Found in
2018.4
2018.4.8f1
2019.2
2019.3
2020.1
Issue ID
1190839
Regression
No
[WebGL] Mouse input is blocked after a few moves when using Edge browser
How to reproduce:
1. Open attached project ("MouseTestWebGL.zip")
2. Open Build Settings window (File->Build Settings...)
3. Select platform to WebGL
4. Click Build And Run
5. From opened browser window copy page URL and paste it to Edge browser
6. Try to move the ball around
Expected result: Mouse moves only the ball
Actual result: Mouse moves the whole player window
Reproducible with: 2018.4.11f1, 2019.2.10f1, 2019.3.b7, 2020.1.0a9
Comments (1)
-
jukka_j
Oct 17, 2019 14:06
To work around the issue, navigate to
C:\Program Files\Unity\Hub\Editor\2019.3.0b7\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\
and edit UnityLoader.js and find "instantiate:" function with lines
var Module = gameInstance.Module;
Module.canvas = document.createElement("canvas");after those two lines, put in
// Disable Microsoft Edge (Chromium-based, tested on 44.17763.771.0) from dragging the whole canvas as an image object when one drags with a mouse over the canvas
Module.canvas.ondragstart = function(e) { e.preventDefault(); };That will remove Edge from attempting to start an image drag on the canvas.
Another workaround, slightly hacky, but self-contained to user template, is to edit the main html file, find
<script>
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/game.json", {onProgress: UnityProgress});
</script>and change it to
<script>
var gameInstance = UnityLoader.instantiate("gameContainer", "Build/game.json", {onProgress: UnityProgress});
function disableEdgeCanvasDrag() {
var canvas = document.querySelector('canvas');
if (!canvas) return setTimeout(disableEdgeCanvasDrag, 1000);
canvas.ondragstart = function(e) { e.preventDefault(); };
}
disableEdgeCanvasDrag();
</script>
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
- [Quest] Pitch Shifter causes audio degradation on Quest 2 devices when sped up
- "GUI Error: Invalid GUILayout" and "NullReferenceException" are thrown when adding Scenes to "Scenes in Baking Set" in Adaptive Probe Volumes
- Inspector window not updating when switching GameObjects in Play Mode while having a VR headset connected
- "UnityException: GetName can only be called from the main thread." erors are thrown when the Shortcuts window is opened and entering Play Mode with a shortcut
- [Android] Light2D visuals stacking over frames when using RenderGraph
Resolution Note (fix version 2020.1):
Fixed with 2020.1.0a16, backported to 2019.3.0f5, 2019.2.19f1, 2018.4.16f1