From d1638b25120a3252aeea7aa5da188d4faf34c7b5 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Thu, 25 Jun 2020 23:20:46 +0200 Subject: [PATCH] getBody/setBody changed to getDOM/setDOM --- src/content.js | 8 ++++---- src/utils.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/content.js b/src/content.js index 67b1407..da96953 100644 --- a/src/content.js +++ b/src/content.js @@ -6,12 +6,12 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => { sendResponse(window.location.href); break; - case 'getBody': - sendResponse(document.body.innerHTML); + case 'getDOM': + sendResponse(document.getElementsByTagName('html')[0].outerHTML); break; - case 'setBody': - document.body.innerHTML = message.html; + case 'setDOM': + document.getElementsByTagName('html')[0].innerHTML = message.html; break; } }); diff --git a/src/utils.js b/src/utils.js index 0a0605c..f53e397 100644 --- a/src/utils.js +++ b/src/utils.js @@ -35,14 +35,14 @@ export default { return await browser.tabs.sendMessage(tab.id, { type: 'getURL' }); }, - async getBody() { + async getDOM() { const tab = await this.getCurrentTab(); - return await browser.tabs.sendMessage(tab.id, { type: 'getBody' }); + return await browser.tabs.sendMessage(tab.id, { type: 'getDOM' }); }, - async setBody(html) { + async setDOM(html) { const tab = await this.getCurrentTab(); - await browser.tabs.sendMessage(tab.id, { type: 'setBody', html: html }); + await browser.tabs.sendMessage(tab.id, { type: 'setDOM', html: html }); }, async run(action, host) {