mirror of
https://github.com/osnr/TabFS.git
synced 2024-05-23 16:02:18 +02:00
screenshot.png works! (when focused, when you kill old debugger)
This commit is contained in:
parent
d34ed5b28c
commit
50c9f62890
|
@ -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"] = {
|
||||
|
|
Loading…
Reference in a new issue