mirror of
https://codeberg.org/kwiat/meowad.git
synced 2025-04-20 11:34:08 +02:00
fix: images not being replaced until hovered, this time it actually works
This commit is contained in:
parent
04ab0e31f7
commit
ba2e3b4b70
1 changed files with 2 additions and 4 deletions
6
main.js
6
main.js
|
@ -26,10 +26,10 @@ const ignoredAdvertisers = [
|
||||||
|
|
||||||
function getAds() {
|
function getAds() {
|
||||||
const ads = [];
|
const ads = [];
|
||||||
document.querySelectorAll("article[data-testid=tweet]:not(.meowified)").forEach((tweet) => {
|
document.querySelectorAll("article[data-testid=tweet]").forEach((tweet) => {
|
||||||
// ads.push(tweet); return;
|
// ads.push(tweet); return;
|
||||||
const span = tweet.querySelector("div.r-1kkk96v span.r-bcqeeo.r-1ttztb7.r-qvutc0.r-poiln3");
|
const span = tweet.querySelector("div.r-1kkk96v span.r-bcqeeo.r-1ttztb7.r-qvutc0.r-poiln3");
|
||||||
if (span && span.innerText === "Ad") {
|
if (span && span.innerText === "Ad" && !span.innerHTML.includes(ad.image)) {
|
||||||
ads.push(tweet);
|
ads.push(tweet);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -38,8 +38,6 @@ function getAds() {
|
||||||
|
|
||||||
function replaceAds() {
|
function replaceAds() {
|
||||||
getAds().forEach((tweet) => {
|
getAds().forEach((tweet) => {
|
||||||
tweet.classList.add("meowified");
|
|
||||||
|
|
||||||
const pfp = tweet.querySelector("[style*=profile_images]");
|
const pfp = tweet.querySelector("[style*=profile_images]");
|
||||||
const tweetText = tweet.querySelector("[data-testid=tweetText]");
|
const tweetText = tweet.querySelector("[data-testid=tweetText]");
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue