aboutsummaryrefslogtreecommitdiffstats
path: root/extension
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2020-12-04 13:44:35 -0800
committerOmar Rizwan <omar@omar.website>2020-12-04 13:44:35 -0800
commite4c92ac4e988ca8fd9d5063d5288cb5f6b261b9c (patch)
treecb1db1064dae49ff01977816d8d4e12b804acea6 /extension
parent50c9f628900423e6d8c2ae542892e60524f8f6bf (diff)
trying to fix resource read. fix releasedir call.
Diffstat (limited to 'extension')
-rw-r--r--extension/background.js8
1 files changed, 7 insertions, 1 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);