Guard browser OPFS INI-named session file group

This commit is contained in:
2026-06-14 02:41:05 +08:00
parent bc70d026bd
commit ee4c4e10af
2 changed files with 67 additions and 4 deletions

View File

@@ -4672,6 +4672,19 @@
return `/work/${filename}`;
}
function opfsCustomSessionFiles(parameterFilename, toolTableFilename) {
return {
filenames: {
parameters: parameterFilename,
toolTable: toolTableFilename,
},
wasm: {
parameters: opfsCustomSessionWasmPath(parameterFilename),
toolTable: opfsCustomSessionWasmPath(toolTableFilename),
},
};
}
function opfsMachineIniWasmPath(machineId) {
return `/work/${machineId}.ini`;
}
@@ -9543,11 +9556,12 @@
);
const iniFileMachineId = "browser-ini-file-session";
const iniFileParameterFilename = "browser-custom.var";
const iniFileToolTableFilename = "browser-custom-tool.tbl";
const iniFileSessionFiles = opfsCustomSessionFiles("browser-custom.var", "browser-custom-tool.tbl");
const iniFileIniWasmPath = opfsMachineIniWasmPath(iniFileMachineId);
const iniFileParameterWasmPath = opfsCustomSessionWasmPath(iniFileParameterFilename);
const iniFileToolTableWasmPath = opfsCustomSessionWasmPath(iniFileToolTableFilename);
const iniFileParameterFilename = iniFileSessionFiles.filenames.parameters;
const iniFileToolTableFilename = iniFileSessionFiles.filenames.toolTable;
const iniFileParameterWasmPath = iniFileSessionFiles.wasm.parameters;
const iniFileToolTableWasmPath = iniFileSessionFiles.wasm.toolTable;
const browserIniFileTextPaths = await saveMachineTextFiles(iniFileMachineId, {
ini: opfsCustomSessionIniText(
iniFileMachineId,