Skip to content

Commit

Permalink
fix: correctly detect posts
Browse files Browse the repository at this point in the history
  • Loading branch information
lppedd committed Feb 27, 2020
1 parent cbd0088 commit b9f419f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function containsAll(elements, elementsToCheck) {
if (elements.length !== elementsToCheck.length) {
function containsAll(elements, elementsToCheck, strict) {
if (strict && elements.length !== elementsToCheck.length) {
return false;
}

Expand Down Expand Up @@ -44,10 +44,10 @@ chrome.storage.local.get({
const mutationObserver = new MutationObserver(() => {
for (let wrapper of document.querySelectorAll('div.userContentWrapper')) {
if (wrapper.firstChild.textContent.search(/corona[ ]?virus/i) >= 0) {
let toRemove = findParentByClasses(wrapper, ['_4-u2', '_4-u8']);
let toRemove = findParentByClasses(wrapper, ['_5va1', '_427x'], true);

if (toRemove == null) {
toRemove = findParentByClasses(wrapper, ['_5va1', '_427x']);
toRemove = findParentByClasses(wrapper, ['_4-u2', '_4-u8'], false);
}

if (debug) {
Expand Down

0 comments on commit b9f419f

Please sign in to comment.