aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/util.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-14 16:37:37 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-12-29 12:33:28 -0500
commitf17b55239e941394908fad4a6b1676a171342dac (patch)
tree2cdaf11a96cdb523fbaa5c4cebda412482005cc1 /ext/bg/js/util.js
parent5045a9a3a063bafae94bc855627cd85f61671d62 (diff)
Implement settings import
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r--ext/bg/js/util.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index 0527dc0b..4c989642 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -155,3 +155,12 @@ function utilReadFile(file) {
reader.readAsBinaryString(file);
});
}
+
+function utilReadFileArrayBuffer(file) {
+ return new Promise((resolve, reject) => {
+ const reader = new FileReader();
+ reader.onload = () => resolve(reader.result);
+ reader.onerror = () => reject(reader.error);
+ reader.readAsArrayBuffer(file);
+ });
+}