Hello again, so i tried what you suggested, by reading those links i learned about Javascript.eval(), but i don't get any response of the server using the code you said, if i place an alert of some kind, it works, but only that.
var file = File.new()
file.open("res://screenshot.png", File.READ)
var base_64_data = Marshalls.raw_to_base64(file.get_buffer(file.get_len()))
var url = base_64_data
var comand = """
var a = document.createElement("a");
a.href = """ + url + """;
a.setAttribute("download" , screenshot);
a.click();
"""
JavaScript.eval(comand, true)