-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27ae5ea
commit fdb6b21
Showing
3 changed files
with
74 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,41 @@ | ||
const rem = () => { | ||
const unwantedElements = document.querySelectorAll( | ||
"[data-temptation-position]" | ||
); | ||
unwantedElements.forEach((elm) => { | ||
console.log("Removed: ", elm); | ||
elm.remove(); | ||
}); | ||
}; | ||
const method = 2; | ||
|
||
const unhideAllElements = () => { | ||
const hiddenItems = document.querySelectorAll("[style]"); | ||
Array.prototype.forEach.call(hiddenItems, (elm) => { | ||
elm.style.cssText = elm.style.cssText.replace(/display: none;/g, ""); | ||
}); | ||
}; | ||
if (method === 1) { | ||
const rem = () => { | ||
const unwantedElements = document.querySelectorAll( | ||
"[data-temptation-position]" | ||
); | ||
unwantedElements.forEach((elm) => { | ||
console.debug("Removed: ", elm); | ||
elm.remove(); | ||
}); | ||
}; | ||
|
||
const run = () => { | ||
chrome.action.setIcon({ path: "icon.png" }) | ||
rem(); | ||
unhideAllElements(); | ||
const unhideAllElements = () => { | ||
const hiddenItems = document.querySelectorAll("[style]"); | ||
Array.prototype.forEach.call(hiddenItems, (elm) => { | ||
elm.style.cssText = elm.style.cssText.replace(/display: none;/g, ""); | ||
}); | ||
}; | ||
|
||
const run = () => { | ||
chrome.action.setIcon({ path: "icon.png" }); | ||
rem(); | ||
unhideAllElements(); | ||
}; | ||
|
||
while (true) { | ||
setTimeout(() => { | ||
run(); | ||
}, 1000); | ||
} | ||
} | ||
|
||
run() | ||
if (method === 2) { | ||
var s = document.createElement("script"); | ||
s.src = chrome.runtime.getURL("script.js"); | ||
s.onload = function () { | ||
this.remove(); | ||
}; | ||
(document.head || document.documentElement).appendChild(s); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
const rem = () => { | ||
const unwantedElements = document.querySelectorAll( | ||
"[data-temptation-position]" | ||
); | ||
unwantedElements.forEach((elm) => { | ||
console.debug("Removed: ", elm); | ||
elm.remove(); | ||
}); | ||
}; | ||
|
||
const unhideAllElements = () => { | ||
const hiddenItems = document.querySelectorAll("[style]"); | ||
Array.prototype.forEach.call(hiddenItems, (elm) => { | ||
elm.style.cssText = elm.style.cssText.replace(/display: none;/g, ""); | ||
}); | ||
}; | ||
|
||
const run = () => { | ||
rem(); | ||
unhideAllElements(); | ||
}; | ||
|
||
run(); | ||
|
||
function sendIt() { | ||
run(); | ||
setTimeout(sendIt, 1000); | ||
} | ||
|
||
setTimeout(sendIt, 1000); |