diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2021-05-21 17:55:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 17:55:36 +0200 |
commit | 8fa07eae145e1e37eb8708ce8c117188b58e3ecc (patch) | |
tree | 4d7e4cc526f209065baba845a0e3ab15d8e99f7c /platform/javascript/api/api.cpp | |
parent | 8c2beeea907cb39baac20df198392ae4fdf64029 (diff) | |
parent | fdf66a21f1a330595f7345f3b0024e0e7cafa28a (diff) |
Merge pull request #48881 from Faless/js/4.x_download_buffer
[HTML5] Add easy to use download API.
Diffstat (limited to 'platform/javascript/api/api.cpp')
-rw-r--r-- | platform/javascript/api/api.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/platform/javascript/api/api.cpp b/platform/javascript/api/api.cpp index 039ce815e4..5ad2bf56cf 100644 --- a/platform/javascript/api/api.cpp +++ b/platform/javascript/api/api.cpp @@ -70,6 +70,7 @@ void JavaScript::_bind_methods() { mi.arguments.push_back(PropertyInfo(Variant::STRING, "object")); ClassDB::bind_vararg_method(METHOD_FLAGS_DEFAULT, "create_object", &JavaScript::_create_object_bind, mi); } + ClassDB::bind_method(D_METHOD("download_buffer", "buffer", "name", "mime"), &JavaScript::download_buffer, DEFVAL("application/octet-stream")); } #if !defined(JAVASCRIPT_ENABLED) || !defined(JAVASCRIPT_EVAL_ENABLED) @@ -100,3 +101,7 @@ Variant JavaScript::_create_object_bind(const Variant **p_args, int p_argcount, return Ref<JavaScriptObject>(); } #endif +#if !defined(JAVASCRIPT_ENABLED) +void JavaScript::download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime) { +} +#endif |