Simplify snippets
This commit is contained in:
parent
987335f51a
commit
f20b711b6e
@ -324,6 +324,14 @@ browser.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||||||
})
|
})
|
||||||
snippets = snippets.filter((item, pos) => item && snippets.indexOf(item) == pos);
|
snippets = snippets.filter((item, pos) => item && snippets.indexOf(item) == pos);
|
||||||
message.identifier = identifier;
|
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);
|
sendResponse(message);
|
||||||
})
|
})
|
Loading…
Reference in New Issue
Block a user