Hello, thanks a lot for the help. Regarding that, I tried things in the version of Godot 3.4 that allows to access to Javascript objects directly. But nothing works.
By analogy to the JS code:
<script>
document.addEventListener("visibilitychange", myFunction);
function myFunction() {
console.log(document.hidden);
}
</script>
I tried in Godot, in my main script:
extends Node
var callback = JavaScript.create_callback(self, "_on_focus_in")
func _on_focus_in():
print("FOCUSSSSSS IN")
func _ready():
JavaScript.get_interface("document").addEventListener("visibilitychange", callback)
Do you have any clue if we can use addEventListener in Godot thru a JavascriptObject ?
Many thanks.