diff options
Diffstat (limited to 'ext/wasm/api/sqlite3-vfs-opfs.c-pp.js')
-rw-r--r-- | ext/wasm/api/sqlite3-vfs-opfs.c-pp.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js index c7a752441..35b7b8865 100644 --- a/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js +++ b/ext/wasm/api/sqlite3-vfs-opfs.c-pp.js @@ -101,6 +101,10 @@ const installOpfsVfs = function callee(options){ options = Object.create(null); } const urlParams = new URL(globalThis.location.href).searchParams; + if(urlParams.has('opfs-disable')){ + //sqlite3.config.warn('Explicitly not installing "opfs" VFS due to opfs-disable flag.'); + return Promise.resolve(sqlite3); + } if(undefined===options.verbose){ options.verbose = urlParams.has('opfs-verbose') ? (+urlParams.get('opfs-verbose') || 2) : 1; @@ -200,9 +204,9 @@ const installOpfsVfs = function callee(options){ opfsVfs.dispose(); return promiseReject_(err); }; - const promiseResolve = (value)=>{ + const promiseResolve = ()=>{ promiseWasRejected = false; - return promiseResolve_(value); + return promiseResolve_(sqlite3); }; const W = //#if target=es6-bundler-friendly @@ -1322,10 +1326,10 @@ const installOpfsVfs = function callee(options){ sqlite3.opfs = opfsUtil; opfsUtil.rootDirectory = d; log("End of OPFS sqlite3_vfs setup.", opfsVfs); - promiseResolve(sqlite3); + promiseResolve(); }).catch(promiseReject); }else{ - promiseResolve(sqlite3); + promiseResolve(); } }catch(e){ error(e); |