aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorNunoSempere <nuno.sempere@protonmail.com>2023-11-08 23:18:10 +0000
committerNunoSempere <nuno.sempere@protonmail.com>2023-11-08 23:18:10 +0000
commit152445c6d7a0743d0210fc29e5989d192b2612fd (patch)
tree190953cfa9041fa92d702950f687358b2561d330 /plugins
parent09c9c50406cf53a1fe500d2ed59e9e0c20e06012 (diff)
try event listener (didn't work)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/style/style.c2
-rw-r--r--plugins/style/style.h2
-rw-r--r--plugins/style/style.js16
3 files changed, 17 insertions, 3 deletions
diff --git a/plugins/style/style.c b/plugins/style/style.c
index 0cd6b4f..a9b4135 100644
--- a/plugins/style/style.c
+++ b/plugins/style/style.c
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#define STYLE_N 4709 + 100
+#define STYLE_N 5436 + 100
void read_style_js(char* string)
{
diff --git a/plugins/style/style.h b/plugins/style/style.h
index 7797eae..1927c79 100644
--- a/plugins/style/style.h
+++ b/plugins/style/style.h
@@ -1,7 +1,7 @@
#ifndef STYLE
#define STYLE
-#define STYLE_N 4709 + 100
+#define STYLE_N 5436 + 100
void read_style_js(char* string);
diff --git a/plugins/style/style.js b/plugins/style/style.js
index 6af94ed..46bbc63 100644
--- a/plugins/style/style.js
+++ b/plugins/style/style.js
@@ -82,12 +82,26 @@ if (document.domain == "twitter.com") {
/* hide video */
[data-testid^="videoPlayer"] {
- display: none;
+ display: none !important;
}
[data-testid^="videoPlayer"]:before {
content: '[twitter video]';
}
`;
+
+ document.addEventListener('DOMContentLoaded', function() {
+ // Select all the videoPlayer elements
+ var videoPlayers = document.querySelectorAll('[data-testid="videoPlayer"]');
+
+ // Loop through the NodeList
+ videoPlayers.forEach(function(videoPlayer) {
+ // Traverse two levels up the DOM tree
+ var grandparentElement = videoPlayer.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement;
+
+ // Hide the grandparent element
+ grandparentElement.style.display = 'none';
+ });
+ });
}
if (document.domain == "reddit.com" || document.domain == "old.reddit.com") {