getBody/setBody changed to getDOM/setDOM
This commit is contained in:
parent
4022139bc7
commit
d1638b2512
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue