summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-05-21 17:55:36 +0200
committerGitHub <noreply@github.com>2021-05-21 17:55:36 +0200
commit8fa07eae145e1e37eb8708ce8c117188b58e3ecc (patch)
tree4d7e4cc526f209065baba845a0e3ab15d8e99f7c /doc/classes
parent8c2beeea907cb39baac20df198392ae4fdf64029 (diff)
parentfdf66a21f1a330595f7345f3b0024e0e7cafa28a (diff)
Merge pull request #48881 from Faless/js/4.x_download_buffer
[HTML5] Add easy to use download API.
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/JavaScript.xml16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/classes/JavaScript.xml b/doc/classes/JavaScript.xml
index e6d74eeb21..c87e637ff5 100644
--- a/doc/classes/JavaScript.xml
+++ b/doc/classes/JavaScript.xml
@@ -29,6 +29,22 @@
Creates a new JavaScript object using the [code]new[/code] constructor. The [code]object[/code] must a valid property of the JavaScript [code]window[/code]. See [JavaScriptObject] for usage.
</description>
</method>
+ <method name="download_buffer">
+ <return type="void">
+ </return>
+ <argument index="0" name="buffer" type="PackedByteArray">
+ </argument>
+ <argument index="1" name="name" type="String">
+ </argument>
+ <argument index="2" name="mime" type="String" default="&quot;application/octet-stream&quot;">
+ </argument>
+ <description>
+ Prompts the user to download a file containing the specified [code]buffer[/code]. The file will have the given [code]name[/code] and [code]mime[/code] type.
+ [b]Note:[/b] The browser may override the [url=https://en.wikipedia.org/wiki/Media_type]MIME type[/url] provided based on the file [code]name[/code]'s extension.
+ [b]Note:[/b] Browsers might block the download if [method download_buffer] is not being called from a user interaction (e.g. button click).
+ [b]Note:[/b] Browsers might ask the user for permission or block the download if multiple download requests are made in a quick succession.
+ </description>
+ </method>
<method name="eval">
<return type="Variant">
</return>