aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extension/background.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/extension/background.js b/extension/background.js
index 0924e56..1932075 100644
--- a/extension/background.js
+++ b/extension/background.js
@@ -171,7 +171,9 @@ router["/tabs/by-id/*/screenshot.png"] = {
await sendDebuggerCommand(tabId, "Page.enable", {});
const {data} = await sendDebuggerCommand(tabId, "Page.captureScreenshot");
- return { buf: utf8(atob(data), offset, size) };
+ const arr = Uint8Array.from(atob(data), c => c.charCodeAt(0));
+ const slice = arr.slice(offset, offset + size);
+ return { buf: String.fromCharCode(...slice) };
}
};
router["/tabs/by-id/*/resources"] = {