diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-12-27 12:17:42 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2022-12-27 12:33:41 +0100 |
commit | 615fd98620d577c82ed9d99fd51ceeee714430ba (patch) | |
tree | 10c8c8cf851933ef9f4f8a4fc08b3baa46521426 /platform/web/api | |
parent | b6e06038f8a373f7fb8d26e92d5f06887e459598 (diff) |
[Web] Expose API to force file system sync.
Mostly useful for modules and extensions that can't use FileAccess to
write files.
Diffstat (limited to 'platform/web/api')
-rw-r--r-- | platform/web/api/api.cpp | 3 | ||||
-rw-r--r-- | platform/web/api/javascript_bridge_singleton.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/platform/web/api/api.cpp b/platform/web/api/api.cpp index e637f2aef2..9f43610d86 100644 --- a/platform/web/api/api.cpp +++ b/platform/web/api/api.cpp @@ -73,6 +73,7 @@ void JavaScriptBridge::_bind_methods() { ClassDB::bind_method(D_METHOD("download_buffer", "buffer", "name", "mime"), &JavaScriptBridge::download_buffer, DEFVAL("application/octet-stream")); ClassDB::bind_method(D_METHOD("pwa_needs_update"), &JavaScriptBridge::pwa_needs_update); ClassDB::bind_method(D_METHOD("pwa_update"), &JavaScriptBridge::pwa_update); + ClassDB::bind_method(D_METHOD("force_fs_sync"), &JavaScriptBridge::force_fs_sync); ADD_SIGNAL(MethodInfo("pwa_update_available")); } @@ -111,6 +112,8 @@ bool JavaScriptBridge::pwa_needs_update() const { Error JavaScriptBridge::pwa_update() { return ERR_UNAVAILABLE; } +void JavaScriptBridge::force_fs_sync() { +} void JavaScriptBridge::download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime) { } #endif diff --git a/platform/web/api/javascript_bridge_singleton.h b/platform/web/api/javascript_bridge_singleton.h index 1e7b5a1699..93288cdea1 100644 --- a/platform/web/api/javascript_bridge_singleton.h +++ b/platform/web/api/javascript_bridge_singleton.h @@ -61,6 +61,7 @@ public: void download_buffer(Vector<uint8_t> p_arr, const String &p_name, const String &p_mime = "application/octet-stream"); bool pwa_needs_update() const; Error pwa_update(); + void force_fs_sync(); static JavaScriptBridge *get_singleton(); JavaScriptBridge(); |