diff options
author | Omar Rizwan <omar.rizwan@gmail.com> | 2020-10-23 12:03:38 -0700 |
---|---|---|
committer | Omar Rizwan <omar.rizwan@gmail.com> | 2020-10-23 12:03:38 -0700 |
commit | eee57547acb4b9a73dffa3c7cceddd6d5d15e5d7 (patch) | |
tree | fd3f2c661d575ce8e0c17da6c07479098f779a7c /extension/background.js | |
parent | 44d5a7ed3c8435aab7851bb8382ec5210de358d7 (diff) |
text file works!
Diffstat (limited to 'extension/background.js')
-rw-r--r-- | extension/background.js | 7 |
1 files changed, 2 insertions, 5 deletions
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": { |