mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
During "opfs" VFS init, check for URL param opfs-disable and, if set, do not install the VFS. Added per forum suggestion to provide a way to help rule out misinteraction between the "opfs" and "opfs-sahpool" VFSes.
FossilOrigin-Name: 29905b7a75b73e32125bf9116033cae7235a135b668a3b783a3d8dcb0bc80374
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user