trying to fix resource read. fix releasedir call.

This commit is contained in:
Omar Rizwan 2020-12-04 13:44:35 -08:00
parent 50c9f62890
commit e4c92ac4e9
2 changed files with 8 additions and 2 deletions

View file

@ -237,7 +237,13 @@ router["/tabs/by-id/*/resources/*"] = {
frameId: frameTree.frame.id,
url: resource.url
});
return { buf: utf8(base64Encoded ? atob(content) : content, offset, size) };
if (base64Encoded) {
const arr = Uint8Array.from(atob(data), c => c.charCodeAt(0));
const slice = arr.slice(offset, offset + size);
return { buf: String.fromCharCode(...slice) };
} else {
return { buf: utf8(content, offset, size) };
}
}
}
throw new UnixError(unix.ENOENT);

View file

@ -212,7 +212,7 @@ tabfs_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
static int
tabfs_releasedir(const char *path, struct fuse_file_info *fi) {
send_request("{op: %Q, path: %Q, fh: %d}",
"release", path, fi->fh);
"releasedir", path, fi->fh);
receive_response("{}", NULL);