From eee57547acb4b9a73dffa3c7cceddd6d5d15e5d7 Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Fri, 23 Oct 2020 12:03:38 -0700 Subject: text file works! --- extension/background.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'extension/background.js') diff --git a/extension/background.js b/extension/background.js index 3888429..1e47b98 100644 --- a/extension/background.js +++ b/extension/background.js @@ -118,11 +118,8 @@ const router = { "text": { async read(path, fh, size, offset) { const tabId = parseInt(pathComponent(path, -2)); - const {result} = await chrome.tabs.executeScript(tabId, {code: "console.log('hi'); document.body.innerText;"}); - /* await debugTab(tabId); - * await sendDebuggerCommand(tabId, "Runtime.enable", {}); - * const {result} = await sendDebuggerCommand(tabId, "Runtime.evaluate", {expression: "document.body.innerText", returnByValue: true});*/ - return result.value.substr(offset, size) + const [result] = await browser.tabs.executeScript(tabId, {code: "document.body.innerText"}); + return result.substr(offset, size) } }, "snapshot.mhtml": { -- cgit v1.2.3