aboutsummaryrefslogtreecommitdiffstats
path: root/extension
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2020-12-04 11:39:26 -0800
committerOmar Rizwan <omar@omar.website>2020-12-04 11:39:26 -0800
commit50c9f628900423e6d8c2ae542892e60524f8f6bf (patch)
treec6230ca185db8f2fef52a7e229ab3ffe7e47116f /extension
parentd34ed5b28cb797bfb08bff56da80b60913873c67 (diff)
screenshot.png works! (when focused, when you kill old debugger)
Diffstat (limited to 'extension')
-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"] = {