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
- Redoing creation of Sub Scenes and Cube GameObjects in Hierarchy throws “Assertion failed on expression: 'targetScene != nullptr’” error in Console window
- Selecting “New Sub Scene” after assigning “New Scene” in Sub Scene Script Component throws “Destroying GameObjects immediately is not permitted” in the Console window
- Shader Graph "Zoom Step Size" can be set to 0 even though the zoom still works
- Enabling/Disabling the Deprecated Nodes doesn't apply to the opened Shader Graph unless any Variable is added to the Blackboard
- Group Selection title text size is smaller in renaming than the actual font size
Resolution Note (fix version 2020.1):
Fixed with 2020.1.0a16, backported to 2019.3.0f5, 2019.2.19f1, 2018.4.16f1