From f20b711b6ee3c14981ab4ff01f8bea4a7e901c42 Mon Sep 17 00:00:00 2001 From: shinigami-eyes <> Date: Sat, 27 Oct 2018 17:03:10 +0200 Subject: [PATCH] Simplify snippets --- extension/content.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/extension/content.js b/extension/content.js index 4f728e2..659557c 100644 --- a/extension/content.js +++ b/extension/content.js @@ -324,6 +324,14 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => { }) snippets = snippets.filter((item, pos) => item && snippets.indexOf(item) == pos); message.identifier = identifier; - message.snippets = snippets.filter((item, pos) => pos <= 10).map(x => x.outerHTML); + message.snippets = snippets.filter((item, pos) => pos <= 10).map(x => { + var html = x.outerHTML; + if(html){ + html = html + .replace(/ alt=""/g, '') + .replace(/__xts__%5B0%5D[\w\.\-]*/g, '__xts__') + } + return html; + }); sendResponse(message); }) \ No newline at end of file