diff options
-rw-r--r-- | extension/background.js | 8 | ||||
-rw-r--r-- | fs/tabfs.c | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/extension/background.js b/extension/background.js index 1932075..16e127c 100644 --- a/extension/background.js +++ b/extension/background.js @@ -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); @@ -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); |