mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
[HTML5] Handle contextmenu, webglcontextlost internally.
This way they are automatically cleaned up when the engine exits, landing a hand to browsers garbage collectors.
This commit is contained in:
parent
9fb27eba8d
commit
8c9a503bde
4 changed files with 14 additions and 11 deletions
|
@ -107,17 +107,6 @@ const Engine = (function () {
|
|||
me.canvas.tabIndex = 0;
|
||||
}
|
||||
|
||||
// Disable right-click context menu.
|
||||
me.canvas.addEventListener('contextmenu', function (ev) {
|
||||
ev.preventDefault();
|
||||
}, false);
|
||||
|
||||
// Until context restoration is implemented warn the user of context loss.
|
||||
me.canvas.addEventListener('webglcontextlost', function (ev) {
|
||||
alert('WebGL context lost, please reload the page'); // eslint-disable-line no-alert
|
||||
ev.preventDefault();
|
||||
}, false);
|
||||
|
||||
// Browser locale, or custom one if defined.
|
||||
let locale = me.customLocale;
|
||||
if (!locale) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue